KTextEditor::Document* KateApp::openDocUrl (const KUrl &url, const QString &encoding, bool isTempFile) { KateMainWindow *mainWindow = activeMainWindow (); if (!mainWindow) return 0; QTextCodec *codec = encoding.isEmpty() ? 0 : QTextCodec::codecForName(encoding.toLatin1()); // this file is no local dir, open it, else warn bool noDir = !url.isLocalFile() || !QFileInfo (url.toLocalFile()).isDir(); KTextEditor::Document *doc=0; if (noDir) { // show no errors... documentManager()->setSuppressOpeningErrorDialogs (true); // open a normal file if (codec) doc=mainWindow->viewManager()->openUrl( url, codec->name(), true, isTempFile); else doc=mainWindow->viewManager()->openUrl( url, QString(), true, isTempFile ); // back to normal.... documentManager()->setSuppressOpeningErrorDialogs (false); } else KMessageBox::sorry( mainWindow, i18n("The file '%1' could not be opened: it is not a normal file, it is a folder.", url.url()) ); return doc; }
void QmlDesignerPlugin::deactivateAutoSynchronization() { viewManager().detachViewsExceptRewriterAndComponetView(); viewManager().detachComponentView(); viewManager().detachRewriterView(); documentManager().currentDesignDocument()->resetToDocumentModel(); disconnect(currentDesignDocument()->rewriterView(), SIGNAL(errorsChanged(QList<RewriterView::Error>)), m_mainWidget, SLOT(updateErrorStatus(QList<RewriterView::Error>))); }