diff --git a/doc/doc.pri b/doc/doc.pri index 4207e364c766b53f2dc01a487c5d62bef801ec23..4ed0de99375f9c6ff5d160920d2f70e3745d30a1 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -7,7 +7,7 @@ unix { } QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp -QCH_FILE = $$OUT_PWD/doc/qtcreator.qch +QCH_FILE = $$OUT_PWD/share/doc/qtcreator/qtcreator.qch unix { html_docs.commands = $$QDOC $$PWD/qtcreator.qdocconf @@ -21,6 +21,11 @@ qch_docs.commands = $$HELPGENERATOR -o $$QCH_FILE $$QHP_FILE qch_docs.depends += html_docs qch_docs.files = $$QCH_FILE +linux-* { + qch_docs.path = /share/doc/qtcreator + INSTALLS += qch_docs +} + macx { cp_docs.commands = $${QMAKE_COPY_DIR} $${OUT_PWD}/doc $${OUT_PWD}/bin/QtCreator.app/Contents/Resources cp_docs.depends += qch_docs diff --git a/qtcreator.pro b/qtcreator.pro index bde9c816c7cada20691d13fe8bbe195c9cd3a8c7..e1e65631d129bdf6ef0151ed5a5200e293cc51f9 100644 --- a/qtcreator.pro +++ b/qtcreator.pro @@ -5,10 +5,10 @@ count(TOO_OLD_LIST, 1) { error("Use at least Qt 4.5.") } +include(doc/doc.pri) +include(share/share.pri) TEMPLATE = subdirs CONFIG += ordered SUBDIRS = src - -include(doc/doc.pri) diff --git a/scripts/shipping/prepare-linux-qt-for-shipping.sh b/scripts/shipping/prepare-linux-qt-for-shipping.sh index 10f4620a2cd082898c34e7789e679483a1133322..869f0e837f87da8447113c3251cd73fbc1b9b065 100755 --- a/scripts/shipping/prepare-linux-qt-for-shipping.sh +++ b/scripts/shipping/prepare-linux-qt-for-shipping.sh @@ -76,20 +76,6 @@ build() { ret=$?; [ ${ret} = 0 ] || exit ${ret} } -fix_rpath() { - folder=$1 - pattern=$2 - rpath=$3 - ( - cd "${destdir}" || die "cd failed" - while read file ; do - echo "Fixing ${file}" - chrpath -r "${rpath}" "${file}" 2>&1 | sed 's/^/\t/' - done < <(find "${folder}" -type f -name "${pattern}") - ) - ret=$?; [ ${ret} = 0 ] || exit ${ret} -} - inst() { ( cd "${dir}" || die "cd failed" @@ -98,22 +84,13 @@ inst() { env -i "${MAKE}" install || die "make install failed" fi + # Fix rpath's cd "${destdir}" || die "cd failed" - - # Fix files bin/* - fix_rpath bin '*' '$ORIGIN/../lib' - - # Fix files lib/*.so - fix_rpath lib '*.so.?.?.?' '$ORIGIN' - fix_rpath lib '*.so.?.?.?.debug' '$ORIGIN' - - # Fix files examples/tools/*/*/*.so - fix_rpath examples/tools '*.so' '$ORIGIN/../../../lib' - fix_rpath examples/tools '*.so.debug' '$ORIGIN/../../../lib' - - # Fix files plugins/*/*.so - fix_rpath plugins '*.so' '$ORIGIN/../../lib' - fix_rpath plugins '*.so.debug' '$ORIGIN/../../lib' + find bin -mindepth 1 -maxdepth 1 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN/../lib' + find lib -mindepth 1 -maxdepth 1 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN' + find . -mindepth 3 -maxdepth 3 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN/../../lib' + find . -mindepth 4 -maxdepth 4 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN/../../../lib' + find . -mindepth 5 -maxdepth 5 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN/../../../../lib' ) ret=$?; [ ${ret} = 0 ] || exit ${ret} } diff --git a/bin/designer/templates.xml b/share/qtcreator/designer/templates.xml similarity index 100% rename from bin/designer/templates.xml rename to share/qtcreator/designer/templates.xml diff --git a/bin/designer/templates/Dialog_with_Buttons_Bottom.ui b/share/qtcreator/designer/templates/Dialog_with_Buttons_Bottom.ui similarity index 100% rename from bin/designer/templates/Dialog_with_Buttons_Bottom.ui rename to share/qtcreator/designer/templates/Dialog_with_Buttons_Bottom.ui diff --git a/bin/designer/templates/Dialog_with_Buttons_Right.ui b/share/qtcreator/designer/templates/Dialog_with_Buttons_Right.ui similarity index 100% rename from bin/designer/templates/Dialog_with_Buttons_Right.ui rename to share/qtcreator/designer/templates/Dialog_with_Buttons_Right.ui diff --git a/bin/designer/templates/Dialog_without_Buttons.ui b/share/qtcreator/designer/templates/Dialog_without_Buttons.ui similarity index 100% rename from bin/designer/templates/Dialog_without_Buttons.ui rename to share/qtcreator/designer/templates/Dialog_without_Buttons.ui diff --git a/bin/designer/templates/Main_Window.ui b/share/qtcreator/designer/templates/Main_Window.ui similarity index 100% rename from bin/designer/templates/Main_Window.ui rename to share/qtcreator/designer/templates/Main_Window.ui diff --git a/bin/designer/templates/Widget.ui b/share/qtcreator/designer/templates/Widget.ui similarity index 100% rename from bin/designer/templates/Widget.ui rename to share/qtcreator/designer/templates/Widget.ui diff --git a/bin/gdbmacros/GPL_EXCEPTION.TXT b/share/qtcreator/gdbmacros/GPL_EXCEPTION.TXT similarity index 100% rename from bin/gdbmacros/GPL_EXCEPTION.TXT rename to share/qtcreator/gdbmacros/GPL_EXCEPTION.TXT diff --git a/bin/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp similarity index 100% rename from bin/gdbmacros/gdbmacros.cpp rename to share/qtcreator/gdbmacros/gdbmacros.cpp diff --git a/bin/gdbmacros/gdbmacros.pro b/share/qtcreator/gdbmacros/gdbmacros.pro similarity index 100% rename from bin/gdbmacros/gdbmacros.pro rename to share/qtcreator/gdbmacros/gdbmacros.pro diff --git a/bin/license.txt b/share/qtcreator/license.txt similarity index 100% rename from bin/license.txt rename to share/qtcreator/license.txt diff --git a/bin/runInTerminal.command b/share/qtcreator/runInTerminal.command similarity index 100% rename from bin/runInTerminal.command rename to share/qtcreator/runInTerminal.command diff --git a/bin/schemes/MS_Visual_C++.kms b/share/qtcreator/schemes/MS_Visual_C++.kms similarity index 100% rename from bin/schemes/MS_Visual_C++.kms rename to share/qtcreator/schemes/MS_Visual_C++.kms diff --git a/bin/schemes/Xcode.kms b/share/qtcreator/schemes/Xcode.kms similarity index 100% rename from bin/schemes/Xcode.kms rename to share/qtcreator/schemes/Xcode.kms diff --git a/bin/snippets/class_generic.snp b/share/qtcreator/snippets/class_generic.snp similarity index 100% rename from bin/snippets/class_generic.snp rename to share/qtcreator/snippets/class_generic.snp diff --git a/bin/snippets/class_qobject.snp b/share/qtcreator/snippets/class_qobject.snp similarity index 100% rename from bin/snippets/class_qobject.snp rename to share/qtcreator/snippets/class_qobject.snp diff --git a/bin/snippets/class_qwidget.snp b/share/qtcreator/snippets/class_qwidget.snp similarity index 100% rename from bin/snippets/class_qwidget.snp rename to share/qtcreator/snippets/class_qwidget.snp diff --git a/bin/snippets/comment.snp b/share/qtcreator/snippets/comment.snp similarity index 100% rename from bin/snippets/comment.snp rename to share/qtcreator/snippets/comment.snp diff --git a/bin/snippets/for.snp b/share/qtcreator/snippets/for.snp similarity index 100% rename from bin/snippets/for.snp rename to share/qtcreator/snippets/for.snp diff --git a/bin/snippets/foreach.snp b/share/qtcreator/snippets/foreach.snp similarity index 100% rename from bin/snippets/foreach.snp rename to share/qtcreator/snippets/foreach.snp diff --git a/bin/snippets/if.snp b/share/qtcreator/snippets/if.snp similarity index 100% rename from bin/snippets/if.snp rename to share/qtcreator/snippets/if.snp diff --git a/bin/snippets/ifelse.snp b/share/qtcreator/snippets/ifelse.snp similarity index 100% rename from bin/snippets/ifelse.snp rename to share/qtcreator/snippets/ifelse.snp diff --git a/bin/templates/qt4project/main.cpp b/share/qtcreator/templates/qt4project/main.cpp similarity index 100% rename from bin/templates/qt4project/main.cpp rename to share/qtcreator/templates/qt4project/main.cpp diff --git a/bin/templates/qt4project/mywidget.cpp b/share/qtcreator/templates/qt4project/mywidget.cpp similarity index 100% rename from bin/templates/qt4project/mywidget.cpp rename to share/qtcreator/templates/qt4project/mywidget.cpp diff --git a/bin/templates/qt4project/mywidget.h b/share/qtcreator/templates/qt4project/mywidget.h similarity index 100% rename from bin/templates/qt4project/mywidget.h rename to share/qtcreator/templates/qt4project/mywidget.h diff --git a/bin/templates/qt4project/mywidget_form.cpp b/share/qtcreator/templates/qt4project/mywidget_form.cpp similarity index 100% rename from bin/templates/qt4project/mywidget_form.cpp rename to share/qtcreator/templates/qt4project/mywidget_form.cpp diff --git a/bin/templates/qt4project/mywidget_form.h b/share/qtcreator/templates/qt4project/mywidget_form.h similarity index 100% rename from bin/templates/qt4project/mywidget_form.h rename to share/qtcreator/templates/qt4project/mywidget_form.h diff --git a/bin/templates/qt4project/widget.ui b/share/qtcreator/templates/qt4project/widget.ui similarity index 100% rename from bin/templates/qt4project/widget.ui rename to share/qtcreator/templates/qt4project/widget.ui diff --git a/share/share.pri b/share/share.pri new file mode 100644 index 0000000000000000000000000000000000000000..50fa37a71a08dd43a86c9ec723a8ad1a5dd99e95 --- /dev/null +++ b/share/share.pri @@ -0,0 +1,81 @@ +macx { + SNIPPETS.path = Contents/Resources + SNIPPETS.files = $$PWD/qtcreator/snippets + TEMPLATES.path = Contents/Resources + TEMPLATES.files = $$PWD/qtcreator/templates + DESIGNER.path = Contents/Resources + DESIGNER.files = $$PWD/qtcreator/designer + SCHEMES.path = Contents/Resources + SCHEMES.files = $$PWD/qtcreator/schemes + GDBDEBUGGER.path = Contents/Resources + GDBDEBUGGER.files = $$PWD/qtcreator/gdbmacros + LICENSE.path = Contents/Resources + LICENSE.files = $$PWD/qtcreator/license.txt + RUNINTERMINAL.path = Contents/Resources + RUNINTERMINAL.files = $$PWD/qtcreator/runInTerminal.command + QMAKE_BUNDLE_DATA += SNIPPETS TEMPLATES DESIGNER SCHEMES GDBDEBUGGER LICENSE RUNINTERMINAL + QMAKE_INFO_PLIST = $$PWD/qtcreator/info.plist +} + +win32 { + # make sure the resources are in place + !exists($$OUT_PWD/app.pro) { + unix:SEPARATOR = ; + win32:SEPARATOR = & + # we are shadow build + COPYSRC = snippets \ + templates \ + designer \ + schemes \ + gdbmacros + COPYDEST = $${OUT_PWD}/../../bin + win32:COPYDEST ~= s|/+|\| + for(tmp,COPYSRC) { + REALSRC = $$PWD/$$tmp + REALDEST = $$COPYDEST/$$tmp + win32:tmp ~= s|/+|\| + win32:REALSRC ~= s|/+|\| + win32:REALDEST ~= s|/+|\| + QMAKE_POST_LINK += $${QMAKE_COPY_DIR} $${REALSRC} $${REALDEST} $$SEPARATOR + } + } +} + +linux-* { + licenses.files += $$PWD/qtcreator/license.txt + licenses.path = /share/qtcreator + + keymaps.files += $$PWD/qtcreator/schemes/MS_Visual_C++.kms + keymaps.files += $$PWD/qtcreator/schemes/Xcode.kms + keymaps.path = /share/qtcreator/schemes + + gdbsupport.files += $$PWD/qtcreator/gdbmacros/GPL_EXCEPTION.TXT + gdbsupport.files += $$PWD/qtcreator/gdbmacros/gdbmacros.cpp + gdbsupport.files += $$PWD/qtcreator/gdbmacros/gdbmacros.pro + gdbsupport.path = /share/qtcreator/gdbmacros + + designertemplates.files += $$PWD/qtcreator/designer/templates.xml + designertemplates.files += $$PWD/qtcreator/designer/templates/* + designertemplates.path = /share/qtcreator/designer/templates + + snippets.files += $$PWD/qtcreator/snippets/*.snp + snippets.path = /share/qtcreator/snippets + + projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget_form.h + projecttemplates.files += $$PWD/qtcreator/templates/qt4project/main.cpp + projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget.cpp + projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget.h + projecttemplates.files += $$PWD/qtcreator/templates/qt4project/widget.ui + projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget_form.cpp + projecttemplates.path = /share/qtcreator/templates/qt4project + + INSTALLS += \ + licenses \ + keymaps \ + gdbsupport \ + designertemplates \ + snippets \ + projecttemplates + +} + diff --git a/shared/help/helpviewer.cpp b/shared/help/helpviewer.cpp index 9b86d8e1cf3bd7944a7af992ca43a62d98945a31..ab95e62b8cd4781baa494989bdb0ee01a24b4399 100644 --- a/shared/help/helpviewer.cpp +++ b/shared/help/helpviewer.cpp @@ -60,12 +60,13 @@ QT_BEGIN_NAMESPACE class HelpNetworkReply : public QNetworkReply { public: - HelpNetworkReply(const QNetworkRequest &request, const QByteArray &fileData); + HelpNetworkReply(const QNetworkRequest &request, const QByteArray &fileData, + const QString &mimeType); virtual void abort(); virtual qint64 bytesAvailable() const - { return data.length() + QNetworkReply::bytesAvailable(); } + { return data.length() + QNetworkReply::bytesAvailable(); } protected: virtual qint64 readData(char *data, qint64 maxlen); @@ -76,13 +77,13 @@ private: }; HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request, - const QByteArray &fileData) + const QByteArray &fileData, const QString &mimeType) : data(fileData), origLen(fileData.length()) { setRequest(request); setOpenMode(QIODevice::ReadOnly); - setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("text/html")); + setHeader(QNetworkRequest::ContentTypeHeader, mimeType); setHeader(QNetworkRequest::ContentLengthHeader, QByteArray::number(origLen)); QTimer::singleShot(0, this, SIGNAL(metaDataChanged())); QTimer::singleShot(0, this, SIGNAL(readyRead())); @@ -127,9 +128,23 @@ HelpNetworkAccessManager::HelpNetworkAccessManager(QHelpEngine *engine, QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) { - const QString scheme = request.url().scheme(); + const QString& scheme = request.url().scheme(); if (scheme == QLatin1String("qthelp") || scheme == QLatin1String("about")) { - return new HelpNetworkReply(request, helpEngine->fileData(request.url())); + const QUrl& url = request.url(); + QString mimeType = url.toString(); + if (mimeType.endsWith(QLatin1String(".svg")) + || mimeType.endsWith(QLatin1String(".svgz"))) { + mimeType = QLatin1String("image/svg+xml"); + } + else if (mimeType.endsWith(QLatin1String(".css"))) { + mimeType = QLatin1String("text/css"); + } + else if (mimeType.endsWith(QLatin1String(".js"))) { + mimeType = QLatin1String("text/javascript"); + } else { + mimeType = QLatin1String("text/html"); + } + return new HelpNetworkReply(request, helpEngine->fileData(url), mimeType); } return QNetworkAccessManager::createRequest(op, request, outgoingData); } @@ -312,7 +327,7 @@ void HelpViewer::setSource(const QUrl &url) if (url.isValid() && !help) { if (launchedWithExternalApp(url)) return; - + QUrl u = helpEngine->findFile(url); if (u.isValid()) { if (!homeUrl.isValid()) diff --git a/src/app/app.pro b/src/app/app.pro index bc8376bbddbe6af634f9be962ef14031cd9eb6c3..a8cb1a8e9dcea30b8b39e0394dea514025dcc37a 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -16,6 +16,9 @@ linux-* { ISGCC33=$$(GCC33) !equals(ISGCC33, 1):QT += svg dbus + target.path = /bin + INSTALLS += target + } TEMPLATE = app @@ -25,55 +28,7 @@ DESTDIR = ../../bin SOURCES += main.cpp -macx { - SNIPPETS.path = Contents/Resources - SNIPPETS.files = $$IDE_SOURCE_TREE/bin/snippets - TEMPLATES.path = Contents/Resources - TEMPLATES.files = $$IDE_SOURCE_TREE/bin/templates - DESIGNER.path = Contents/Resources - DESIGNER.files = $$IDE_SOURCE_TREE/bin/designer - SCHEMES.path = Contents/Resources - SCHEMES.files = $$IDE_SOURCE_TREE/bin/schemes - GDBDEBUGGER.path = Contents/Resources - GDBDEBUGGER.files = $$IDE_SOURCE_TREE/bin/gdbmacros - LICENSE.path = Contents/Resources - LICENSE.files = $$IDE_SOURCE_TREE/bin/license.txt - RUNINTERMINAL.path = Contents/Resources - RUNINTERMINAL.files = $$IDE_SOURCE_TREE/bin/runInTerminal.command - QMAKE_BUNDLE_DATA += SNIPPETS TEMPLATES DESIGNER SCHEMES GDBDEBUGGER LICENSE RUNINTERMINAL - QMAKE_INFO_PLIST = $$PWD/Info.plist -} -!macx { - # make sure the resources are in place - !exists($$OUT_PWD/app.pro) { - unix:SEPARATOR = ; - win32:SEPARATOR = & - # we are shadow build - COPYSRC = snippets \ - templates \ - designer \ - schemes \ - gdbmacros - COPYDEST = $${OUT_PWD}/../../bin - win32:COPYDEST ~= s|/+|\| - for(tmp,COPYSRC) { - REALSRC = $$IDE_SOURCE_TREE/bin/$$tmp - REALDEST = $$COPYDEST/$$tmp - win32:tmp ~= s|/+|\| - win32:REALSRC ~= s|/+|\| - win32:REALDEST ~= s|/+|\| - QMAKE_POST_LINK += $${QMAKE_COPY_DIR} $${REALSRC} $${REALDEST} $$SEPARATOR - } - } -} - -linux-* { - #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR - QMAKE_RPATHDIR += \$\$ORIGIN/../lib - IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") - QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\' - QMAKE_RPATHDIR = -} +include(../rpath.pri) win32 { RC_FILE = qtcreator.rc @@ -82,3 +37,4 @@ win32 { macx { ICON = qtcreator.icns } + diff --git a/src/app/main.cpp b/src/app/main.cpp index 479ef576c3b86e086882464368cb9bc9793b3e16..c10c476991dbf26eb1ad67b63b69409c95bb3a79 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -180,12 +180,16 @@ static inline QStringList getPluginPaths() QDir rootDir = QApplication::applicationDirPath(); rootDir.cdUp(); const QString rootDirPath = rootDir.canonicalPath(); - // 1) "lib" dir + // 1) "plugins" (Win/Linux) QString pluginPath = rootDirPath; pluginPath += QDir::separator(); pluginPath += QLatin1String("lib"); + pluginPath += QDir::separator(); + pluginPath += QLatin1String("qtcreator"); + pluginPath += QDir::separator(); + pluginPath += QLatin1String("plugins"); rc.push_back(pluginPath); - // 2) "PlugIns" + // 2) "PlugIns" (OS X) pluginPath = rootDirPath; pluginPath += QDir::separator(); pluginPath += QLatin1String("PlugIns"); diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 8a4198b4bf0dbc1a96c64d4ad6dd7ca48cb0545e..7d7e3c9f7e01147aa9fceffa727845ebdc4afa67 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -234,12 +234,11 @@ public: BinEditorInterface(BinEditor *parent) : Core::IEditor(parent) { - Core::ICore *core = Core::ICore::instance(); + Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); m_editor = parent; m_file = new BinEditorFile(parent); - m_context << core->uniqueIDManager()-> - uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR); - m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR); + m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR); + m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR); m_cursorPositionLabel = new Core::Utils::LineColumnLabel; QHBoxLayout *l = new QHBoxLayout; @@ -320,8 +319,8 @@ QString BinEditorFactory::kind() const Core::IFile *BinEditorFactory::open(const QString &fileName) { - Core::ICore *core = Core::ICore::instance(); - Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind()); + Core::EditorManager *em = Core::EditorManager::instance(); + Core::IEditor *iface = em->openEditor(fileName, kind()); return iface ? iface->file() : 0; } @@ -339,27 +338,17 @@ QStringList BinEditorFactory::mimeTypes() const ///////////////////////////////// BinEditorPlugin ////////////////////////////////// -BinEditorPlugin *BinEditorPlugin::m_instance = 0; - BinEditorPlugin::BinEditorPlugin() { m_undoAction = m_redoAction = m_copyAction = m_selectAllAction = 0; - m_instance = this; } BinEditorPlugin::~BinEditorPlugin() { - m_instance = 0; -} - -BinEditorPlugin *BinEditorPlugin::instance() -{ - return m_instance; } QAction *BinEditorPlugin::registerNewAction(const QString &id, const QString &title) { - QAction *result = new QAction(title, this); Core::ICore::instance()->actionManager()->registerAction(result, id, m_context); return result; @@ -384,8 +373,8 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor) QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed())); editor->setEditorInterface(editorInterface); - Core::ICore *core = Core::ICore::instance(); - m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR); + Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); + m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR); if (!m_undoAction) { m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO), this, SLOT(undoAction()), diff --git a/src/plugins/bineditor/bineditorplugin.h b/src/plugins/bineditor/bineditorplugin.h index ddc4333acdb5c36514060642c9ee98228f052a1a..a7c782697075fa7a1c7c467afee3a58bf8e511db 100644 --- a/src/plugins/bineditor/bineditorplugin.h +++ b/src/plugins/bineditor/bineditorplugin.h @@ -43,7 +43,6 @@ #include <QtGui/QAction> namespace Core { -class ICore; class IWizard; } @@ -61,8 +60,6 @@ public: BinEditorPlugin(); ~BinEditorPlugin(); - static BinEditorPlugin *instance(); - bool initialize(const QStringList &arguments, QString *error_message = 0); void extensionsInitialized(); @@ -77,6 +74,7 @@ private slots: void updateActions(); void updateCurrentEditor(Core::IContext *object); + private: QList<int> m_context; QAction *registerNewAction(const QString &id, const QString &title = QString()); @@ -90,9 +88,6 @@ private: friend class BinEditorFactory; Core::IEditor *createEditor(QWidget *parent); - static BinEditorPlugin *m_instance; - - Core::ICore *m_core; typedef QList<Core::IWizard *> WizardList; WizardList m_wizards; BinEditorFactory *m_factory; diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 3d9ea294d927d0eef495f8da7b2a4d9280e33009..fa8eaefa55c1b30e8bc3e709e4eeb4d352d62945 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -293,8 +293,7 @@ void BookmarkView::gotoBookmark(const QModelIndex &index) BookmarkContext::BookmarkContext(BookmarkView *widget) : m_bookmarkView(widget) { - Core::ICore *core = ICore::instance(); - m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT); + m_context << UniqueIDManager::instance()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT); } QList<int> BookmarkContext::context() const @@ -509,7 +508,7 @@ void BookmarkManager::documentPrevNext(bool next) nextLine = markLine; } - Core::EditorManager *em = Core::ICore::instance()->editorManager(); + Core::EditorManager *em = Core::EditorManager::instance(); em->addCurrentPositionToNavigationHistory(true); if (next) { if (nextLine == -1) @@ -554,7 +553,7 @@ void BookmarkManager::prev() TextEditor::ITextEditor *BookmarkManager::currentTextEditor() const { - Core::EditorManager *em = Core::ICore::instance()->editorManager(); + Core::EditorManager *em = Core::EditorManager::instance(); Core::IEditor *currEditor = em->currentEditor(); if (!currEditor) return 0; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 966c0144355d73273e7d03b0db7d9ce527e3f7dc..845255eda5d8c1e0be6481fe7aa1804e7e7db28e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -36,7 +36,6 @@ #include "cmakeproject.h" #include "cmakeprojectconstants.h" -#include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <projectexplorer/projectexplorerconstants.h> @@ -44,9 +43,9 @@ using namespace CMakeProjectManager::Internal; CMakeManager::CMakeManager() { - Core::ICore *core = Core::ICore::instance(); - m_projectContext = core->uniqueIDManager()->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT); - m_projectLanguage = core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX); + Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); + m_projectContext = uidm->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT); + m_projectLanguage = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX); } int CMakeManager::projectContext() const diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.cpp b/src/plugins/coreplugin/actionmanager/commandsfile.cpp index 85d7d172a1dc65732b4c26ce74f3a4350a6d134a..8fc086079bbd113d40057800535abe4b871e77f1 100644 --- a/src/plugins/coreplugin/actionmanager/commandsfile.cpp +++ b/src/plugins/coreplugin/actionmanager/commandsfile.cpp @@ -109,8 +109,7 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items) QDomElement root = doc.createElement("mapping"); doc.appendChild(root); - for (int i = 0; i < items.count(); ++i) { - ShortcutItem *item = items.at(i); + foreach (const ShortcutItem *item, items) { QDomElement ctag = doc.createElement("shortcut"); ctag.setAttribute(QLatin1String("id"), idmanager->stringForUniqueIdentifier(item->m_cmd->id())); root.appendChild(ctag); diff --git a/src/plugins/coreplugin/basefilewizard.cpp b/src/plugins/coreplugin/basefilewizard.cpp index 17cf04615b5e1cb1025c9721a0227737ecf6fcbc..e98fd2ce8c9fb9bab8174f760d5f9b87d43e328a 100644 --- a/src/plugins/coreplugin/basefilewizard.cpp +++ b/src/plugins/coreplugin/basefilewizard.cpp @@ -32,12 +32,13 @@ ***************************************************************************/ #include "basefilewizard.h" + +#include "coreconstants.h" +#include "icore.h" +#include "ifilewizardextension.h" #include "mimedatabase.h" +#include "editormanager/editormanager.h" -#include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/icore.h> -#include <coreplugin/coreconstants.h> -#include <coreplugin/ifilewizardextension.h> #include <extensionsystem/pluginmanager.h> #include <utils/filewizarddialog.h> @@ -509,7 +510,7 @@ bool BaseFileWizard::postGenerateFiles(const GeneratedFiles &l, QString *errorMe { // File mode: open the editors in file mode and ensure editor pane const Core::GeneratedFiles::const_iterator cend = l.constEnd(); - Core::EditorManager *em = Core::ICore::instance()->editorManager(); + Core::EditorManager *em = Core::EditorManager::instance(); for (Core::GeneratedFiles::const_iterator it = l.constBegin(); it != cend; ++it) { if (!em->openEditor(it->path(), it->editorKind())) { *errorMessage = tr("Failed to open an editor for %1").arg(it->path()); diff --git a/src/plugins/coreplugin/coreimpl.cpp b/src/plugins/coreplugin/coreimpl.cpp index 9f8ec24b576b20712c6447f3d5c04317c26f3d92..e9a3799d62802e9a6e2f91ddce0b3d4ba4a9c6a5 100644 --- a/src/plugins/coreplugin/coreimpl.cpp +++ b/src/plugins/coreplugin/coreimpl.cpp @@ -148,7 +148,7 @@ QString CoreImpl::resourcePath() const #if defined(Q_OS_MAC) return QDir::cleanPath(QCoreApplication::applicationDirPath()+QLatin1String("/../Resources")); #else - return QDir::cleanPath(QCoreApplication::applicationDirPath()); + return QDir::cleanPath(QCoreApplication::applicationDirPath())+"/../share/qtcreator"; #endif } diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index b947b54827cefd168c20658f70642d58c458b84f..c6bc596b282d8e33e07c793d981c848477809bc2 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -85,7 +85,7 @@ bool CorePlugin::initialize(const QStringList & /*arguments*/, QString *error_me m_welcomeMode = new WelcomeMode; addObject(m_welcomeMode); - EditorManager *editorManager = qobject_cast<EditorManager*>(m_mainWindow->editorManager()); + EditorManager *editorManager = m_mainWindow->editorManager(); m_editMode = new EditMode(editorManager); addObject(m_editMode); } diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index 45c769c525445b1847fb2ff6039a83a2e032a879..822b550c33b2f46cfdbb43b6624bf8bbaaa09762 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -163,3 +163,10 @@ RESOURCES += core.qrc \ contains(QT_CONFIG, webkit) { QT += webkit } + +linux-* { + images.files = images/qtcreator_logo_*.png + images.path = /share/pixmaps + + INSTALLS += images +} diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 7792f8ee383d7b21b17b5f06ee150ca1acae5d7b..7668bf83228fbd111ab0a22d494c9b44d76f4c68 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -599,8 +599,7 @@ QList<IEditor*> return found.toList(); } -QList<IFile *> - EditorManager::filesForEditors(QList<IEditor *> editors) const +QList<IFile *> EditorManager::filesForEditors(QList<IEditor *> editors) const { QSet<IEditor *> handledEditors; QList<IFile *> files; @@ -941,9 +940,8 @@ QStringList EditorManager::getOpenFileNames() const void EditorManager::ensureEditorManagerVisible() { - if (!isVisible()) { + if (!isVisible()) m_d->m_core->modeManager()->activateMode(Constants::MODE_EDIT); - } } IEditor *EditorManager::newFile(const QString &editorKind, diff --git a/src/plugins/coreplugin/editormanager/editorsplitter.cpp b/src/plugins/coreplugin/editormanager/editorsplitter.cpp index 0b43372b120ddb761c7d4c99b281bf0b36bfd946..fd2260d5c99777dd36d33c00ffd706565bfd4672 100644 --- a/src/plugins/coreplugin/editormanager/editorsplitter.cpp +++ b/src/plugins/coreplugin/editormanager/editorsplitter.cpp @@ -33,15 +33,14 @@ #include "editorsplitter.h" +#include "coreconstants.h" #include "editormanager.h" +#include "icore.h" #include "minisplitter.h" #include "openeditorswindow.h" #include "stackededitorgroup.h" - -#include <coreplugin/icore.h> -#include <coreplugin/coreconstants.h> -#include <coreplugin/uniqueidmanager.h> -#include <coreplugin/actionmanager/actionmanager.h> +#include "uniqueidmanager.h" +#include "actionmanager/actionmanager.h" #include <utils/qtcassert.h> diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp index 9af2376505330b3f208bd49193f7d4d9115e507f..0877c9932bff0a4b8a2cc4c7717a1821cdfb5f47 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp @@ -120,8 +120,7 @@ void OpenEditorsWidget::closeEditors() core->fileManager()->saveModifiedFiles(selectedFiles, &cancelled); if (cancelled) return; - core->editorManager()-> - closeEditors(selectedEditors); + core->editorManager()->closeEditors(selectedEditors); updateEditorList(); */ } diff --git a/src/plugins/coreplugin/filemanager.cpp b/src/plugins/coreplugin/filemanager.cpp index d94649cba5a989ef811ad0b7642123590274cf65..afafa92d75744ad6ba8094459410ef83ac5174c5 100644 --- a/src/plugins/coreplugin/filemanager.cpp +++ b/src/plugins/coreplugin/filemanager.cpp @@ -33,13 +33,14 @@ #include "filemanager.h" +#include "editormanager.h" +#include "icore.h" #include "ifile.h" +#include "iversioncontrol.h" #include "mainwindow.h" +#include "mimedatabase.h" #include "saveitemsdialog.h" #include "vcsmanager.h" -#include "editormanager.h" -#include "mimedatabase.h" -#include "iversioncontrol.h" #include <utils/qtcassert.h> @@ -509,7 +510,7 @@ void FileManager::syncWithEditor(Core::IContext *context) if (!context) return; - Core::IEditor *editor = Core::ICore::instance()->editorManager()->currentEditor(); + Core::IEditor *editor = Core::EditorManager::instance()->currentEditor(); if (editor && (editor->widget() == context->widget())) setCurrentFile(editor->file()->fileName()); } diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 86e7582b8cc1215bc23a3395d6da1012d958f186..f15db0347ad2abe9388439f77f4407d45810ef46 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -380,7 +380,7 @@ void MainWindow::registerDefaultContainers() menubar->appendGroup(Constants::G_WINDOW); menubar->appendGroup(Constants::G_HELP); - //File Menu + // File Menu ActionContainer *filemenu = am->createMenu(Constants::M_FILE); menubar->addMenu(filemenu, Constants::G_FILE); filemenu->menu()->setTitle(tr("&File")); @@ -394,7 +394,7 @@ void MainWindow::registerDefaultContainers() connect(filemenu->menu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowRecentFiles())); - //Edit Menu + // Edit Menu ActionContainer *medit = am->createMenu(Constants::M_EDIT); menubar->addMenu(medit, Constants::G_EDIT); medit->menu()->setTitle(tr("&Edit")); @@ -405,12 +405,12 @@ void MainWindow::registerDefaultContainers() medit->appendGroup(Constants::G_EDIT_FIND); medit->appendGroup(Constants::G_EDIT_OTHER); - //Tools Menu + // Tools Menu ActionContainer *ac = am->createMenu(Constants::M_TOOLS); menubar->addMenu(ac, Constants::G_TOOLS); ac->menu()->setTitle(tr("&Tools")); - //Window Menu + // Window Menu ActionContainer *mwindow = am->createMenu(Constants::M_WINDOW); menubar->addMenu(mwindow, Constants::G_WINDOW); mwindow->menu()->setTitle(tr("&Window")); @@ -423,7 +423,7 @@ void MainWindow::registerDefaultContainers() mwindow->appendGroup(Constants::G_WINDOW_OTHER); mwindow->appendGroup(Constants::G_WINDOW_LIST); - //Help Menu + // Help Menu ac = am->createMenu(Constants::M_HELP); menubar->addMenu(ac, Constants::G_HELP); ac->menu()->setTitle(tr("&Help")); @@ -476,43 +476,43 @@ void MainWindow::registerDefaultActions() cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Advanced"), m_globalContext); medit->addAction(cmd, Constants::G_EDIT_ADVANCED); - //Tools menu separators + // Tools menu separators cmd = createSeparator(am, this, QLatin1String("QtCreator.Tools.Sep.Options"), m_globalContext); mtools->addAction(cmd, Constants::G_DEFAULT_THREE); - //Return to editor shortcut: Note this requires Qt to fix up + // Return to editor shortcut: Note this requires Qt to fix up // handling of shortcut overrides in menus, item views, combos.... m_focusToEditor = new QShortcut(this); cmd = am->registerShortcut(m_focusToEditor, Constants::S_RETURNTOEDITOR, m_globalContext); cmd->setDefaultKeySequence(QKeySequence(Qt::Key_Escape)); connect(m_focusToEditor, SIGNAL(activated()), this, SLOT(setFocusToEditor())); - //New File Action + // New File Action m_newAction = new QAction(QIcon(Constants::ICON_NEWFILE), tr("&New..."), this); cmd = am->registerAction(m_newAction, Constants::NEW, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::New); mfile->addAction(cmd, Constants::G_FILE_NEW); connect(m_newAction, SIGNAL(triggered()), this, SLOT(newFile())); - //Open Action + // Open Action m_openAction = new QAction(QIcon(Constants::ICON_OPENFILE), tr("&Open..."), this); cmd = am->registerAction(m_openAction, Constants::OPEN, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Open); mfile->addAction(cmd, Constants::G_FILE_OPEN); connect(m_openAction, SIGNAL(triggered()), this, SLOT(openFile())); - //Open With Action + // Open With Action m_openWithAction = new QAction(tr("&Open With..."), this); cmd = am->registerAction(m_openWithAction, Constants::OPEN_WITH, m_globalContext); mfile->addAction(cmd, Constants::G_FILE_OPEN); connect(m_openWithAction, SIGNAL(triggered()), this, SLOT(openFileWith())); - //File->Recent Files Menu + // File->Recent Files Menu ActionContainer *ac = am->createMenu(Constants::M_FILE_RECENTFILES); mfile->addMenu(ac, Constants::G_FILE_OPEN); ac->menu()->setTitle(tr("Recent Files")); - //Save Action + // Save Action QAction *tmpaction = new QAction(QIcon(Constants::ICON_SAVEFILE), tr("&Save"), this); cmd = am->registerAction(tmpaction, Constants::SAVE, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Save); @@ -520,7 +520,7 @@ void MainWindow::registerDefaultActions() cmd->setDefaultText(tr("&Save")); mfile->addAction(cmd, Constants::G_FILE_SAVE); - //Save As Action + // Save As Action tmpaction = new QAction(tr("Save &As..."), this); cmd = am->registerAction(tmpaction, Constants::SAVEAS, m_globalContext); #ifdef Q_OS_MAC @@ -530,7 +530,7 @@ void MainWindow::registerDefaultActions() cmd->setDefaultText(tr("Save &As...")); mfile->addAction(cmd, Constants::G_FILE_SAVE); - //SaveAll Action + // SaveAll Action m_saveAllAction = new QAction(tr("Save A&ll"), this); cmd = am->registerAction(m_saveAllAction, Constants::SAVEALL, m_globalContext); #ifndef Q_OS_MAC @@ -539,19 +539,19 @@ void MainWindow::registerDefaultActions() mfile->addAction(cmd, Constants::G_FILE_SAVE); connect(m_saveAllAction, SIGNAL(triggered()), this, SLOT(saveAll())); - //Print Action + // Print Action tmpaction = new QAction(tr("&Print..."), this); cmd = am->registerAction(tmpaction, Constants::PRINT, m_globalContext); mfile->addAction(cmd, Constants::G_FILE_PRINT); - //Exit Action + // Exit Action m_exitAction = new QAction(tr("E&xit"), this); cmd = am->registerAction(m_exitAction, Constants::EXIT, m_globalContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Q"))); mfile->addAction(cmd, Constants::G_FILE_OTHER); connect(m_exitAction, SIGNAL(triggered()), this, SLOT(exit())); - //Undo Action + // Undo Action tmpaction = new QAction(QIcon(Constants::ICON_UNDO), tr("&Undo"), this); cmd = am->registerAction(tmpaction, Constants::UNDO, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Undo); @@ -559,7 +559,7 @@ void MainWindow::registerDefaultActions() cmd->setDefaultText(tr("&Undo")); medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); - //Redo Action + // Redo Action tmpaction = new QAction(QIcon(Constants::ICON_REDO), tr("&Redo"), this); cmd = am->registerAction(tmpaction, Constants::REDO, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Redo); @@ -567,37 +567,37 @@ void MainWindow::registerDefaultActions() cmd->setDefaultText(tr("&Redo")); medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); - //Cut Action + // Cut Action tmpaction = new QAction(QIcon(Constants::ICON_CUT), tr("Cu&t"), this); cmd = am->registerAction(tmpaction, Constants::CUT, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Cut); medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); - //Copy Action + // Copy Action tmpaction = new QAction(QIcon(Constants::ICON_COPY), tr("&Copy"), this); cmd = am->registerAction(tmpaction, Constants::COPY, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Copy); medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); - //Paste Action + // Paste Action tmpaction = new QAction(QIcon(Constants::ICON_PASTE), tr("&Paste"), this); cmd = am->registerAction(tmpaction, Constants::PASTE, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Paste); medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); - //Select All + // Select All tmpaction = new QAction(tr("&Select All"), this); cmd = am->registerAction(tmpaction, Constants::SELECTALL, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::SelectAll); medit->addAction(cmd, Constants::G_EDIT_SELECTALL); - //Goto Action + // Goto Action tmpaction = new QAction(tr("&Go To Line..."), this); cmd = am->registerAction(tmpaction, Constants::GOTO, m_globalContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+L"))); medit->addAction(cmd, Constants::G_EDIT_OTHER); - //Options Action + // Options Action m_optionsAction = new QAction(tr("&Options..."), this); cmd = am->registerAction(m_optionsAction, Constants::OPTIONS, m_globalContext); #ifdef Q_OS_MAC @@ -607,25 +607,25 @@ void MainWindow::registerDefaultActions() connect(m_optionsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog())); #ifdef Q_OS_MAC - //Minimize Action + // Minimize Action m_minimizeAction = new QAction(tr("Minimize"), this); cmd = am->registerAction(m_minimizeAction, Constants::MINIMIZE_WINDOW, m_globalContext); cmd->setDefaultKeySequence(QKeySequence("Ctrl+M")); mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); connect(m_minimizeAction, SIGNAL(triggered()), this, SLOT(showMinimized())); - //Zoom Action + // Zoom Action m_zoomAction = new QAction(tr("Zoom"), this); cmd = am->registerAction(m_zoomAction, Constants::ZOOM_WINDOW, m_globalContext); mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); connect(m_zoomAction, SIGNAL(triggered()), this, SLOT(showMaximized())); - //Window separator + // Window separator cmd = createSeparator(am, this, QLatin1String("QtCreator.Window.Sep.Size"), m_globalContext); mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); #endif - // Toggle Sidebar Action + // Show Sidebar Action m_toggleSideBarAction = new QAction(QIcon(Constants::ICON_TOGGLE_SIDEBAR), tr("Show Sidebar"), this); m_toggleSideBarAction->setCheckable(true); @@ -641,19 +641,16 @@ void MainWindow::registerDefaultActions() m_toggleSideBarAction->setEnabled(false); #if !defined(Q_OS_MAC) - // Toggle Full Screen - m_toggleFullScreenAction = new QAction(tr("Toggle Fullscreen"), this); + // Full Screen Action + m_toggleFullScreenAction = new QAction(tr("Full Screen"), this); m_toggleFullScreenAction->setCheckable(true); - m_toggleFullScreenAction->setChecked(false); - cmd = am->registerAction(m_toggleFullScreenAction, - Constants::TOGGLE_FULLSCREEN, m_globalContext); + cmd = am->registerAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN, m_globalContext); cmd->setDefaultKeySequence(QKeySequence("Ctrl+Shift+F11")); mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); - connect(m_toggleFullScreenAction, SIGNAL(triggered(bool)), - this, SLOT(setFullScreen(bool))); + connect(m_toggleFullScreenAction, SIGNAL(triggered(bool)), this, SLOT(setFullScreen(bool))); #endif - //About IDE Action + // About IDE Action #ifdef Q_OS_MAC tmpaction = new QAction(tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu #else @@ -672,7 +669,7 @@ void MainWindow::registerDefaultActions() cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); #endif connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins())); - //About Qt Action + // About Qt Action // tmpaction = new QAction(tr("About &Qt..."), this); // cmd = am->registerAction(tmpaction, Constants:: ABOUT_QT, m_globalContext); // mhelp->addAction(cmd, Constants::G_HELP_ABOUT); @@ -937,10 +934,8 @@ void MainWindow::changeEvent(QEvent *e) m_minimizeAction->setEnabled(!minimized); m_zoomAction->setEnabled(!minimized); #else - QWindowStateChangeEvent *ev = - static_cast<QWindowStateChangeEvent *>(e); - bool isFullScreen = (ev->oldState() & Qt::WindowFullScreen) != 0; - m_toggleFullScreenAction->setChecked(!isFullScreen); + bool isFullScreen = (windowState() & Qt::WindowFullScreen) != 0; + m_toggleFullScreenAction->setChecked(isFullScreen); #endif } } diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index e1fb1d9c6626aeb7466c66ce919881fe4c10965e..4fa8f7472c16e529836fa96a0bf5b092dfd593e3 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -34,7 +34,7 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include "icore.h" +#include "core_global.h" #include <QtGui/QMainWindow> #include <QtCore/QMap> @@ -61,6 +61,7 @@ class BaseView; class EditorManager; class FileManager; class IContext; +class IWizard; class MessageManager; class MimeDatabase; class ModeManager; @@ -103,7 +104,6 @@ public: void openFiles(const QStringList &fileNames); - //ICore inline ExtensionSystem::PluginManager *pluginManager() { return m_pluginManager; } Core::ActionManager *actionManager() const; Core::FileManager *fileManager() const; diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 64006ff723609143d507643a2c9a7ba01c965ac4..05c47261f3ab4c1b81a93844d808e3b636e44857 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -35,6 +35,7 @@ #include "fancytabwidget.h" #include "fancyactionbar.h" +#include "icore.h" #include "mainwindow.h" #include <aggregation/aggregate.h> diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index 1141909aa0cf611cd26a3c32fb16f3874955d7e0..6329f70ed94cb14045fc243367e5544d6eb86d4e 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -33,12 +33,13 @@ #include "navigationwidget.h" -#include <coreplugin/icore.h> -#include <coreplugin/coreconstants.h> -#include <coreplugin/inavigationwidgetfactory.h> -#include <coreplugin/modemanager.h> -#include <coreplugin/uniqueidmanager.h> -#include <coreplugin/actionmanager/actionmanager.h> +#include "icore.h" +#include "coreconstants.h" +#include "inavigationwidgetfactory.h" +#include "modemanager.h" +#include "uniqueidmanager.h" +#include "actionmanager/actionmanager.h" + #include <extensionsystem/pluginmanager.h> #include <QtCore/QDebug> diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index 1e4411ba7c5fc581aff7c98a55d419425e58cd6b..1556f7e05cbb22cdb18d0901cf8758a9cba16b85 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -33,6 +33,7 @@ #include "outputpane.h" #include "coreconstants.h" +#include "icore.h" #include "ioutputpane.h" #include "mainwindow.h" #include "modemanager.h" @@ -55,7 +56,6 @@ #include <QtGui/QToolBar> #include <QtGui/QToolButton> #include <QtGui/QStackedWidget> -#include <QDebug> using namespace Core; using namespace Core::Internal; diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h b/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h index 40768f0fa9bcc808e199a4291a1695d4da592865..e05778a832d84b68332b8491b4c2321ec808712c 100644 --- a/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h +++ b/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h @@ -35,13 +35,15 @@ #define SCRIPTMANAGER_P_H #include <coreplugin/scriptmanager/scriptmanager.h> -#include <coreplugin/icore.h> #include <QtCore/QObject> #include <QtCore/QList> #include <QtScript/QScriptEngine> namespace Core { + +class ICore; + namespace Internal { class ScriptManagerPrivate : public Core::ScriptManager diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index af4cbabbbe808ebafe7d8e0d6574212bd9286eb0..4558ccaae88e3ed544085ffdc24bec71574ac873 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -84,8 +84,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m // Create the globalcontext list to register actions accordingly QList<int> globalcontext; - globalcontext << ICore::instance()->uniqueIDManager()-> - uniqueIdentifier(Core::Constants::C_GLOBAL); + globalcontext << UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL); // Create the settings Page m_settingsPage = new SettingsPage(); @@ -129,7 +128,7 @@ void CodepasterPlugin::post() { if (m_poster) delete m_poster; - IEditor* editor = ICore::instance()->editorManager()->currentEditor(); + IEditor* editor = EditorManager::instance()->currentEditor(); ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor); if (!textEditor) return; @@ -240,8 +239,7 @@ void CustomFetcher::customRequestFinished(int, bool error) QByteArray data = body(); if (!m_listWidget) { QString title = QString::fromLatin1("Code Paster: %1").arg(m_id); - ICore::instance()->editorManager()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR - , &title, data); + EditorManager::instance()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR, &title, data); } else { m_listWidget->clear(); QStringList lines = QString(data).split(QLatin1Char('\n')); diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 0a9cf3958b21e7fdb7aa01a537cdb752f75111c6..b370faea1bb626a110c666102dbe4e4b7db9eda8 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -139,10 +139,10 @@ QualifiedNameId *qualifiedNameIdForSymbol(Symbol *s, const LookupContext &contex CPPEditorEditable::CPPEditorEditable(CPPEditor *editor) : BaseTextEditorEditable(editor) { - Core::ICore *core = Core::ICore::instance(); - m_context << core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR); - m_context << core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX); - m_context << core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); + Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); + m_context << uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR); + m_context << uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX); + m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); } CPPEditor::CPPEditor(QWidget *parent) @@ -334,10 +334,10 @@ void CPPEditor::jumpToMethod(int) if (! symbol) return; - Core::ICore::instance()->editorManager()->addCurrentPositionToNavigationHistory(true); + Core::EditorManager::instance()->addCurrentPositionToNavigationHistory(true); int line = symbol->line(); gotoLine(line); - Core::ICore::instance()->editorManager()->addCurrentPositionToNavigationHistory(); + Core::EditorManager::instance()->addCurrentPositionToNavigationHistory(); setFocus(); } @@ -440,9 +440,9 @@ void CPPEditor::switchDeclarationDefinition() return; Function *f = lastSymbol->asFunction(); - if (! f) { + if (!f) { Scope *fs = lastSymbol->scope(); - if (! fs->isFunctionScope()) + if (!fs->isFunctionScope()) fs = fs->enclosingFunctionScope(); if (fs) f = fs->owner()->asFunction(); diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp index 3d09e02fc026921ad1c71acc7fcbdbcdee3a7f93..e600de92c586d3eb7cdf445508d2a2296d504a68 100644 --- a/src/plugins/cppeditor/cppplugin.cpp +++ b/src/plugins/cppeditor/cppplugin.cpp @@ -88,7 +88,7 @@ QString CppPluginEditorFactory::kind() const Core::IFile *CppPluginEditorFactory::open(const QString &fileName) { - Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind()); + Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind()); return iface ? iface->file() : 0; } @@ -238,20 +238,18 @@ void CppPlugin::extensionsInitialized() void CppPlugin::switchDeclarationDefinition() { - Core::ICore *core = Core::ICore::instance(); - CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget()); - if (editor) { + Core::EditorManager *em = Core::EditorManager::instance(); + CPPEditor *editor = qobject_cast<CPPEditor*>(em->currentEditor()->widget()); + if (editor) editor->switchDeclarationDefinition(); - } } void CppPlugin::jumpToDefinition() { - Core::ICore *core = Core::ICore::instance(); - CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget()); - if (editor) { + Core::EditorManager *em = Core::EditorManager::instance(); + CPPEditor *editor = qobject_cast<CPPEditor*>(em->currentEditor()->widget()); + if (editor) editor->jumpToDefinition(); - } } Q_EXPORT_PLUGIN(CppPlugin) diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index c28c4a8127d499a39005520b4c7e31cb5d520993..3a8c271a0989729f59d80d37b8957a9fabd592c3 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -147,7 +147,7 @@ void CppToolsPlugin::shutdown() void CppToolsPlugin::switchHeaderSource() { - Core::EditorManager *editorManager = Core::ICore::instance()->editorManager(); + Core::EditorManager *editorManager = Core::EditorManager::instance(); Core::IEditor *editor = editorManager->currentEditor(); QString otherFile = correspondingHeaderOrSource(editor->file()->fileName()); if (!otherFile.isEmpty()) { diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index a42c10382048fcd677b1fbe86dc8e0a521d882f9..07904b8efa3acd29d74d47ff61c27e6a9685921f 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -723,18 +723,17 @@ void DebuggerPlugin::activatePreviousMode() void DebuggerPlugin::activateDebugMode() { - ICore *core = ICore::instance(); - Core::ModeManager *modeManager = core->modeManager(); + ModeManager *modeManager = ModeManager::instance(); m_previousMode = QLatin1String(modeManager->currentMode()->uniqueModeName()); modeManager->activateMode(QLatin1String(MODE_DEBUG)); } void DebuggerPlugin::queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **object) { - ICore *core = ICore::instance(); - if (!core || !core->editorManager()) + EditorManager *editorManager = EditorManager::instance(); + if (!editorManager) return; - Core::IEditor *editor = core->editorManager()->currentEditor(); + Core::IEditor *editor = editorManager->currentEditor(); ITextEditor *textEditor = qobject_cast<ITextEditor*>(editor); if (!textEditor) return; diff --git a/src/plugins/designer/cpp/formclasswizarddialog.cpp b/src/plugins/designer/cpp/formclasswizarddialog.cpp index 748e1b1d021b444025cc0b163702e113115e3f48..3dc30d9c83fcf0bea32e09f21ebc5df37eb53c09 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.cpp +++ b/src/plugins/designer/cpp/formclasswizarddialog.cpp @@ -50,7 +50,7 @@ namespace Internal { FormClassWizardDialog::FormClassWizardDialog(const WizardPageList &extensionPages, QWidget *parent) : QWizard(parent), - m_formPage(new FormTemplateWizardPagePage), + m_formPage(new FormTemplateWizardPage), m_classPage(new FormClassWizardPage) { setWindowTitle(tr("Qt Designer Form Class")); @@ -97,8 +97,8 @@ void FormClassWizardDialog::slotCurrentIdChanged(int id) m_rawFormTemplate = m_formPage->templateContents(); // Strip namespaces from the ui class and suggest it as a new class // name - if (FormTemplateWizardPagePage::getUIXmlData(m_rawFormTemplate, &formBaseClass, &uiClassName)) - m_classPage->setClassName(FormTemplateWizardPagePage::stripNamespaces(uiClassName)); + if (FormTemplateWizardPage::getUIXmlData(m_rawFormTemplate, &formBaseClass, &uiClassName)) + m_classPage->setClassName(FormTemplateWizardPage::stripNamespaces(uiClassName)); } } @@ -107,7 +107,7 @@ FormClassWizardParameters FormClassWizardDialog::parameters() const FormClassWizardParameters rc; m_classPage->getParameters(&rc); // Name the ui class in the Ui namespace after the class specified - rc.uiTemplate = FormTemplateWizardPagePage::changeUiClassName(m_rawFormTemplate, rc.className); + rc.uiTemplate = FormTemplateWizardPage::changeUiClassName(m_rawFormTemplate, rc.className); return rc; } diff --git a/src/plugins/designer/cpp/formclasswizarddialog.h b/src/plugins/designer/cpp/formclasswizarddialog.h index 4c61e5f09c7c9426bf0fd79ccae75ead59e3bfc7..13a804fb2f1c811e2b78c90e4f489343632e3f7c 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.h +++ b/src/plugins/designer/cpp/formclasswizarddialog.h @@ -45,7 +45,7 @@ namespace Internal { struct FormClassWizardParameters; class FormClassWizardPage; -class FormTemplateWizardPagePage; +class FormTemplateWizardPage; class FormClassWizardDialog : public QWizard { @@ -73,7 +73,7 @@ private slots: void slotCurrentIdChanged(int id); private: - FormTemplateWizardPagePage *m_formPage; + FormTemplateWizardPage *m_formPage; FormClassWizardPage *m_classPage; QString m_rawFormTemplate; }; diff --git a/src/plugins/designer/cpp/formclasswizardparameters.cpp b/src/plugins/designer/cpp/formclasswizardparameters.cpp index 81c67331de3da59ca2bd4d225a0cecbe95e1e24b..a5b2facf1d92d03280d638ea705370d1e5ca43a7 100644 --- a/src/plugins/designer/cpp/formclasswizardparameters.cpp +++ b/src/plugins/designer/cpp/formclasswizardparameters.cpp @@ -57,7 +57,7 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in const QString indent = QString(indentation, QLatin1Char(' ')); QString formBaseClass; QString uiClassName; - if (!FormTemplateWizardPagePage::getUIXmlData(uiTemplate, &formBaseClass, &uiClassName)) { + if (!FormTemplateWizardPage::getUIXmlData(uiTemplate, &formBaseClass, &uiClassName)) { qWarning("Unable to determine the form base class from %s.", uiTemplate.toUtf8().constData()); return false; } @@ -107,7 +107,7 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in if (embedding == PointerAggregatedUiClass) { headerStr << '\n' << namespaceIndent << "namespace " << uiNamespaceC << " {\n" - << namespaceIndent << indent << "class " << FormTemplateWizardPagePage::stripNamespaces(uiClassName) << ";\n" + << namespaceIndent << indent << "class " << FormTemplateWizardPage::stripNamespaces(uiClassName) << ";\n" << namespaceIndent << "}\n"; } diff --git a/src/plugins/designer/formeditorfactory.cpp b/src/plugins/designer/formeditorfactory.cpp index b07140eff61491eb0530579ea418dbb3da995689..df3c59adfa3f6a3fe06261e55f6bcb386548ab7b 100644 --- a/src/plugins/designer/formeditorfactory.cpp +++ b/src/plugins/designer/formeditorfactory.cpp @@ -63,7 +63,7 @@ QString FormEditorFactory::kind() const Core::IFile *FormEditorFactory::open(const QString &fileName) { - Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind()); + Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind()); return iface ? iface->file() : 0; } diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index da8374091d5f17e6506570b6a7f122e725524287..58de33f2753e997c9f159ec4d0cf5c13e2170a4c 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -40,6 +40,7 @@ #include "workbenchintegration.h" #include <coreplugin/coreconstants.h> +#include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/editormanager/editormanager.h> diff --git a/src/plugins/designer/formtemplatewizardpage.cpp b/src/plugins/designer/formtemplatewizardpage.cpp index 4a8c99070091853fda537b753d3bbf76d19ce6aa..aacda476a16ba72ac061e6ff974463d55e5301fc 100644 --- a/src/plugins/designer/formtemplatewizardpage.cpp +++ b/src/plugins/designer/formtemplatewizardpage.cpp @@ -55,9 +55,9 @@ namespace Designer { namespace Internal { -// ----------------- FormTemplateWizardPagePage +// ----------------- FormTemplateWizardPage -FormTemplateWizardPagePage::FormTemplateWizardPagePage(QWidget * parent) : +FormTemplateWizardPage::FormTemplateWizardPage(QWidget * parent) : QWizardPage(parent), m_newFormWidget(QDesignerNewFormWidgetInterface::createNewFormWidget(FormEditorW::instance()->designerEditor())), m_templateSelected(m_newFormWidget->hasCurrentTemplate()) @@ -74,12 +74,12 @@ FormTemplateWizardPagePage::FormTemplateWizardPagePage(QWidget * parent) : setLayout(layout); } -bool FormTemplateWizardPagePage::isComplete() const +bool FormTemplateWizardPage::isComplete() const { return m_templateSelected; } -void FormTemplateWizardPagePage::slotCurrentTemplateChanged(bool templateSelected) +void FormTemplateWizardPage::slotCurrentTemplateChanged(bool templateSelected) { if (m_templateSelected == templateSelected) return; @@ -87,7 +87,7 @@ void FormTemplateWizardPagePage::slotCurrentTemplateChanged(bool templateSelecte emit completeChanged(); } -bool FormTemplateWizardPagePage::validatePage() +bool FormTemplateWizardPage::validatePage() { QString errorMessage; m_templateContents = m_newFormWidget->currentTemplate(&errorMessage); @@ -98,7 +98,7 @@ bool FormTemplateWizardPagePage::validatePage() return true; } -QString FormTemplateWizardPagePage::stripNamespaces(const QString &className) +QString FormTemplateWizardPage::stripNamespaces(const QString &className) { QString rc = className; const int namespaceIndex = rc.lastIndexOf(QLatin1String("::")); @@ -107,7 +107,7 @@ QString FormTemplateWizardPagePage::stripNamespaces(const QString &className) return rc; } -bool FormTemplateWizardPagePage::getUIXmlData(const QString &uiXml, +bool FormTemplateWizardPage::getUIXmlData(const QString &uiXml, QString *formBaseClass, QString *uiClassName) { @@ -179,7 +179,7 @@ static const char *classNameChangingSheetFormatC = "</xsl:template>\n" "</xsl:stylesheet>\n"; -QString FormTemplateWizardPagePage::changeUiClassName(const QString &uiXml, const QString &newUiClassName) +QString FormTemplateWizardPage::changeUiClassName(const QString &uiXml, const QString &newUiClassName) { // Prepare I/O: Sheet const QString xsltSheet = QString::fromLatin1(classNameChangingSheetFormatC).arg(newUiClassName); @@ -280,7 +280,7 @@ namespace { // of the <class> element, as name of the first <widget> element, and possibly // in the signal/slot connections -QString FormTemplateWizardPagePage::changeUiClassName(const QString &uiXml, const QString &newUiClassName) +QString FormTemplateWizardPage::changeUiClassName(const QString &uiXml, const QString &newUiClassName) { QDomDocument domUi; if (!domUi.setContent(uiXml)) { diff --git a/src/plugins/designer/formtemplatewizardpage.h b/src/plugins/designer/formtemplatewizardpage.h index 6b375386b5899b91ec0e57d48bc0d8b030d2ceb2..3c62b4f15f8b89684a30b7ee09bfba01cabc09ea 100644 --- a/src/plugins/designer/formtemplatewizardpage.h +++ b/src/plugins/designer/formtemplatewizardpage.h @@ -46,12 +46,12 @@ namespace Internal { // A wizard page embedding Qt Designer's QDesignerNewFormWidgetInterface // widget. -class FormTemplateWizardPagePage : public QWizardPage +class FormTemplateWizardPage : public QWizardPage { - Q_DISABLE_COPY(FormTemplateWizardPagePage) + Q_DISABLE_COPY(FormTemplateWizardPage) Q_OBJECT public: - explicit FormTemplateWizardPagePage(QWidget * parent = 0); + explicit FormTemplateWizardPage(QWidget * parent = 0); virtual bool isComplete () const; virtual bool validatePage(); diff --git a/src/plugins/designer/formwizarddialog.cpp b/src/plugins/designer/formwizarddialog.cpp index d7905a56545df2b4befdc75f7941bcae857f71fd..4fef805c2cc533fdc157de6be15dfb19be79e694 100644 --- a/src/plugins/designer/formwizarddialog.cpp +++ b/src/plugins/designer/formwizarddialog.cpp @@ -53,7 +53,7 @@ namespace Internal { FormWizardDialog::FormWizardDialog(const WizardPageList &extensionPages, QWidget *parent) : QWizard(parent), - m_formPage(new FormTemplateWizardPagePage) + m_formPage(new FormTemplateWizardPage) { init(extensionPages); } @@ -114,8 +114,8 @@ void FormFileWizardDialog::slotCurrentIdChanged(int id) // the ui class QString formBaseClass; QString uiClassName; - if (FormTemplateWizardPagePage::getUIXmlData(templateContents(), &formBaseClass, &uiClassName)) { - QString fileName = FormTemplateWizardPagePage::stripNamespaces(uiClassName).toLower(); + if (FormTemplateWizardPage::getUIXmlData(templateContents(), &formBaseClass, &uiClassName)) { + QString fileName = FormTemplateWizardPage::stripNamespaces(uiClassName).toLower(); fileName += QLatin1String(".ui"); m_filePage->setName(fileName); } diff --git a/src/plugins/designer/formwizarddialog.h b/src/plugins/designer/formwizarddialog.h index 0ecd7274b1d1ce2fc7a3f49ff322e9a19e918f6b..36069b34452a4c3583ec6c75f55d67eae0cebf7b 100644 --- a/src/plugins/designer/formwizarddialog.h +++ b/src/plugins/designer/formwizarddialog.h @@ -45,7 +45,7 @@ namespace Utils { namespace Designer { namespace Internal { -class FormTemplateWizardPagePage; +class FormTemplateWizardPage; // Single-Page Wizard for new forms offering all types known to Qt Designer. // To be used for Mode "CreateNewEditor" [not currently used] @@ -65,7 +65,7 @@ public: private: void init(const WizardPageList &extensionPages); - FormTemplateWizardPagePage *m_formPage; + FormTemplateWizardPage *m_formPage; mutable QString m_templateContents; }; diff --git a/src/plugins/designer/settingspage.h b/src/plugins/designer/settingspage.h index 8ad707dd76937a6acd5d37cc7b429f9bfb59e26b..bba91cd5de6b11fd21149973a3163d572f69e4e8 100644 --- a/src/plugins/designer/settingspage.h +++ b/src/plugins/designer/settingspage.h @@ -34,7 +34,6 @@ #ifndef DESIGNER_SETTINGSPAGE_H #define DESIGNER_SETTINGSPAGE_H -#include <coreplugin/icore.h> #include <coreplugin/dialogs/ioptionspage.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 32663da298efff44ab69aaf9aa6371403fc7fd94..9236b8930bbfe8a5f9e4f9f581ccaac50f3168a2 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -105,7 +105,7 @@ enum SubMode ChangeSubMode, DeleteSubMode, FilterSubMode, - ReplaceSubMode, + ReplaceSubMode, // used for R and r YankSubMode, IndentSubMode, ZSubMode, @@ -113,11 +113,13 @@ enum SubMode enum SubSubMode { + // typically used for things that require one more data item + // and are 'nested' behind a mode NoSubSubMode, FtSubSubMode, // used for f, F, t, T MarkSubSubMode, // used for m BackTickSubSubMode, // used for ` - TickSubSubMode // used for ' + TickSubSubMode, // used for ' }; enum VisualMode @@ -137,20 +139,20 @@ enum MoveType struct EditOperation { - EditOperation() : m_position(-1), m_itemCount(0) {} - int m_position; - int m_itemCount; // used to combine several operations - QString m_from; - QString m_to; + EditOperation() : position(-1), itemCount(0) {} + int position; + int itemCount; // used to combine several operations + QString from; + QString to; }; QDebug &operator<<(QDebug &ts, const EditOperation &op) { - if (op.m_itemCount > 0) { - ts << "\n EDIT BLOCK WITH " << op.m_itemCount << " ITEMS"; + if (op.itemCount > 0) { + ts << "\n EDIT BLOCK WITH " << op.itemCount << " ITEMS"; } else { - ts << "\n EDIT AT " << op.m_position - << "\n FROM " << op.m_from << "\n TO " << op.m_to; + ts << "\n EDIT AT " << op.position + << "\n FROM " << op.from << "\n TO " << op.to; } return ts; } @@ -188,7 +190,7 @@ private: int count() const { return mvCount() * opCount(); } int leftDist() const { return m_tc.position() - m_tc.block().position(); } int rightDist() const { return m_tc.block().length() - leftDist() - 1; } - bool atEol() const { return m_tc.atBlockEnd() && m_tc.block().length()>1; } + bool atEndOfLine() const { return m_tc.atBlockEnd() && m_tc.block().length()>1; } int lastPositionInDocument() const; int positionForLine(int line) const; // 1 based line, 0 based pos @@ -284,11 +286,11 @@ public: void recordInsert(int position, const QString &data); void recordRemove(int position, const QString &data); void recordRemove(int position, int length); - void recordMove(int position, int nestedCount); void recordRemoveNextChar(); void recordInsertText(const QString &data); QString recordRemoveSelectedText(); + void recordMove(); void recordBeginGroup(); void recordEndGroup(); int anchor() const { return m_anchor; } @@ -301,7 +303,6 @@ public: QStack<int> m_undoGroupStack; // extra data for '.' - QString m_dotCount; QString m_dotCommand; // history for '/' @@ -367,6 +368,7 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev) quit(); return true; } + m_mode = CommandMode; return false; } @@ -391,7 +393,7 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev) bool handled = handleKey(key, um, ev->text()); // We fake vi-style end-of-line behaviour - m_fakeEnd = (atEol() && m_mode == CommandMode); + m_fakeEnd = (atEndOfLine() && m_mode == CommandMode); if (m_fakeEnd) moveLeft(); @@ -446,7 +448,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) m_registers[m_register] = recordRemoveSelectedText(); recordEndGroup(); m_submode = NoSubMode; - if (atEol()) + if (atEndOfLine()) moveLeft(); } else if (m_submode == YankSubMode) { m_registers[m_register] = selectedText(); @@ -467,6 +469,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) m_submode = NoSubMode; } else if (m_moveType == MoveExclusive) { moveLeft(); // correct + m_moveType = MoveInclusive; } m_mvcount.clear(); m_opcount.clear(); @@ -631,12 +634,6 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveDown(count()); m_moveType = MoveLineWise; finishMovement("y"); - } else if (m_submode == ReplaceSubMode) { - if (atEol()) - moveLeft(KeepAnchor); - else - m_tc.deleteChar(); - recordInsertText(text); } else if (m_submode == IndentSubMode && key == '=') { indentRegion(m_tc.block(), m_tc.block().next()); finishMovement(); @@ -654,6 +651,22 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, handleFfTt(key); m_subsubmode = NoSubSubMode; finishMovement(QString(QChar(m_subsubdata)) + QChar(key)); + } else if (m_submode == ReplaceSubMode) { + if (count() < rightDist() && text.size() == 1 + && (text.at(0).isPrint() || text.at(0).isSpace())) { + recordBeginGroup(); + setAnchor(); + moveRight(count()); + recordRemoveSelectedText(); + recordInsertText(QString(count(), text.at(0))); + recordEndGroup(); + m_moveType = MoveExclusive; + m_submode = NoSubMode; + m_dotCommand = QString("%1r%2").arg(count()).arg(text); + finishMovement(); + } else { + m_submode = NoSubMode; + } } else if (m_subsubmode == MarkSubSubMode) { m_marks[key] = m_tc.position(); m_subsubmode = NoSubSubMode; @@ -748,7 +761,8 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_mode = InsertMode; recordBeginGroup(); m_lastInsertion.clear(); - moveRight(); + if (!atEndOfLine()) + moveRight(); updateMiniBuffer(); } else if (key == 'A') { m_mode = InsertMode; @@ -773,7 +787,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_mode = InsertMode; finishMovement(); } else if (key == 'd' && m_visualMode == NoVisualMode) { - if (atEol()) + if (atEndOfLine()) moveLeft(); setAnchor(); recordBeginGroup(); @@ -827,7 +841,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else if (key == 'i') { enterInsertMode(); updateMiniBuffer(); - if (atEol()) + if (atEndOfLine()) moveLeft(); } else if (key == 'I') { setAnchor(); @@ -915,25 +929,35 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, //qDebug() << "REGISTERS: " << m_registers << "MOVE: " << m_moveType; //qDebug() << "LINES: " << n << text << m_register; if (n > 0) { + recordMove(); moveToStartOfLine(); - if (key == 'p') - moveDown(); - recordInsertText(text); - moveUp(n); + m_desiredColumn = 0; + for (int i = count(); --i >= 0; ) { + if (key == 'p') + moveDown(); + recordInsertText(text); + moveUp(n); + } } else { - if (key == 'p') - moveRight(); - recordInsertText(text); - moveLeft(); + m_desiredColumn = 0; + for (int i = count(); --i >= 0; ) { + if (key == 'p') + moveRight(); + recordInsertText(text); + moveLeft(); + } } recordEndGroup(); - m_dotCommand = "p"; + m_dotCommand = QString("%1p").arg(count()); + finishMovement(); } else if (key == 'r') { - recordBeginGroup(); m_submode = ReplaceSubMode; m_dotCommand = "r"; } else if (key == 'R') { + // FIXME: right now we repeat the insertion count() times, + // but not the deletion recordBeginGroup(); + m_lastInsertion.clear(); m_mode = InsertMode; m_submode = ReplaceSubMode; m_dotCommand = "R"; @@ -971,9 +995,10 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveToNextWord(true); finishMovement("W"); } else if (key == 'x') { // = "dl" - if (atEol()) + if (atEndOfLine()) moveLeft(); recordBeginGroup(); + setAnchor(); m_submode = DeleteSubMode; moveRight(qMin(count(), rightDist())); finishMovement("l"); @@ -986,7 +1011,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, finishMovement(); } else if (key == 'y') { m_savedYankPosition = m_tc.position(); - if (atEol()) + if (atEndOfLine()) moveLeft(); recordBeginGroup(); setAnchor(); @@ -1000,7 +1025,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else if (key == 'z') { recordBeginGroup(); m_submode = ZSubMode; - } else if (key == '~' && !atEol()) { + } else if (key == '~' && !atEndOfLine()) { recordBeginGroup(); setAnchor(); moveRight(qMin(count(), rightDist())); @@ -1018,7 +1043,9 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveUp(count() * (linesOnScreen() - 2)); finishMovement(); } else if (key == Key_Delete) { - m_tc.deleteChar(); + setAnchor(); + moveRight(qMin(1, rightDist())); + recordRemoveSelectedText(); } else if (key == Key_Escape) { if (m_visualMode != NoVisualMode) leaveVisualMode(); @@ -1084,7 +1111,7 @@ bool FakeVimHandler::Private::handleInsertMode(int key, int, const QString &text } else if (!text.isEmpty()) { m_lastInsertion.append(text); if (m_submode == ReplaceSubMode) { - if (atEol()) + if (atEndOfLine()) m_submode = NoSubMode; else m_tc.deleteChar(); @@ -1356,9 +1383,9 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) m_tc.setPosition(positionForLine(beginLine)); EditOperation op; // FIXME: broken for "upward selection" - op.m_position = m_tc.position(); - op.m_from = text; - op.m_to = result; + op.position = m_tc.position(); + op.from = text; + op.to = result; recordOperation(op); enterCommandMode(); @@ -1619,7 +1646,7 @@ void FakeVimHandler::Private::moveToMatchingParanthesis() #if 0 // FIXME: remove TextEditor dependency bool undoFakeEOL = false; - if (atEol()) { + if (atEndOfLine()) { m_tc.movePosition(Left, KeepAnchor, 1); undoFakeEOL = true; } @@ -1748,60 +1775,52 @@ QWidget *FakeVimHandler::Private::editor() const void FakeVimHandler::Private::undo() { -#if 0 - EDITOR(undo()); -#else if (m_undoStack.isEmpty()) { showBlackMessage(tr("Already at oldest change")); } else { EditOperation op = m_undoStack.pop(); //qDebug() << "UNDO " << op; - if (op.m_itemCount > 0) { - for (int i = op.m_itemCount; --i >= 0; ) + if (op.itemCount > 0) { + for (int i = op.itemCount; --i >= 0; ) undo(); } else { - m_tc.setPosition(op.m_position, MoveAnchor); - if (!op.m_to.isEmpty()) { - m_tc.setPosition(op.m_position + op.m_to.size(), KeepAnchor); - m_tc.deleteChar(); + m_tc.setPosition(op.position, MoveAnchor); + if (!op.to.isEmpty()) { + m_tc.setPosition(op.position + op.to.size(), KeepAnchor); + m_tc.removeSelectedText(); } - if (!op.m_from.isEmpty()) - m_tc.insertText(op.m_from); - m_tc.setPosition(op.m_position, MoveAnchor); + if (!op.from.isEmpty()) + m_tc.insertText(op.from); + m_tc.setPosition(op.position, MoveAnchor); } m_redoStack.push(op); showBlackMessage(QString()); } -#endif } void FakeVimHandler::Private::redo() { -#if 0 - EDITOR(redo()); -#else if (m_redoStack.isEmpty()) { showBlackMessage(tr("Already at newest change")); } else { EditOperation op = m_redoStack.pop(); //qDebug() << "REDO " << op; - if (op.m_itemCount > 0) { - for (int i = op.m_itemCount; --i >= 0; ) + if (op.itemCount > 0) { + for (int i = op.itemCount; --i >= 0; ) redo(); } else { - m_tc.setPosition(op.m_position, MoveAnchor); - if (!op.m_from.isEmpty()) { - m_tc.setPosition(op.m_position + op.m_from.size(), KeepAnchor); - m_tc.deleteChar(); + m_tc.setPosition(op.position, MoveAnchor); + if (!op.from.isEmpty()) { + m_tc.setPosition(op.position + op.from.size(), KeepAnchor); + m_tc.removeSelectedText(); } - if (!op.m_to.isEmpty()) - m_tc.insertText(op.m_to); - m_tc.setPosition(op.m_position, MoveAnchor); + if (!op.to.isEmpty()) + m_tc.insertText(op.to); + m_tc.setPosition(op.position, MoveAnchor); } m_undoStack.push(op); showBlackMessage(QString()); } -#endif } void FakeVimHandler::Private::recordBeginGroup() @@ -1809,29 +1828,37 @@ void FakeVimHandler::Private::recordBeginGroup() //qDebug() << "PUSH"; m_undoGroupStack.push(m_undoStack.size()); EditOperation op; - op.m_position = m_tc.position(); + op.position = m_tc.position(); recordOperation(op); } void FakeVimHandler::Private::recordEndGroup() { + if (m_undoGroupStack.isEmpty()) { + qWarning("fakevim: undo groups not balanced.\n"); + return; + } EditOperation op; - op.m_itemCount = m_undoStack.size() - m_undoGroupStack.pop(); - //qDebug() << "POP " << op.m_itemCount; + op.itemCount = m_undoStack.size() - m_undoGroupStack.pop(); + //qDebug() << "POP " << op.itemCount << m_undoStack; recordOperation(op); } QString FakeVimHandler::Private::recordRemoveSelectedText() { EditOperation op; - //qDebug() << "1 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor(); - m_tc.setPosition(anchor(), KeepAnchor); - op.m_position = qMin(position(), anchor()); - //qDebug() << "2 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor(); - op.m_from = m_tc.selection().toPlainText(); + //qDebug() << "POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor(); + int pos = m_tc.position(); + if (pos == anchor()) + return QString(); + m_tc.setPosition(anchor(), MoveAnchor); + m_tc.setPosition(pos, KeepAnchor); + op.position = qMin(pos, anchor()); + op.from = m_tc.selection().toPlainText(); + //qDebug() << "OP: " << op; recordOperation(op); - m_tc.deleteChar(); - return op.m_from; + m_tc.removeSelectedText(); + return op.from; } void FakeVimHandler::Private::recordRemoveNextChar() @@ -1844,32 +1871,41 @@ void FakeVimHandler::Private::recordRemoveNextChar() void FakeVimHandler::Private::recordInsertText(const QString &data) { EditOperation op; - op.m_position = m_tc.position(); - op.m_to = data; + op.position = m_tc.position(); + op.to = data; recordOperation(op); m_tc.insertText(data); } -void FakeVimHandler::Private::recordOperation(const EditOperation &op) +void FakeVimHandler::Private::recordMove() { - //qDebug() << "OP: " << op; + EditOperation op; + op.position = m_tc.position(); m_undoStack.push(op); m_redoStack.clear(); + //qDebug() << "MOVE: " << op; + //qDebug() << "\nSTACK: " << m_undoStack; } -void FakeVimHandler::Private::recordMove(int position, int nestedCount) +void FakeVimHandler::Private::recordOperation(const EditOperation &op) { - EditOperation op; - op.m_position = position; - op.m_itemCount = nestedCount; - recordOperation(op); + //qDebug() << "OP: " << op; + // No need to record operations that actually do not change anything. + if (op.from.isEmpty() && op.to.isEmpty() && op.itemCount == 0) + return; + // No need to create groups with only one member. + if (op.itemCount == 1) + return; + m_undoStack.push(op); + m_redoStack.clear(); + //qDebug() << "\nSTACK: " << m_undoStack; } void FakeVimHandler::Private::recordInsert(int position, const QString &data) { EditOperation op; - op.m_position = position; - op.m_to = data; + op.position = position; + op.to = data; recordOperation(op); } @@ -1884,8 +1920,8 @@ void FakeVimHandler::Private::recordRemove(int position, int length) void FakeVimHandler::Private::recordRemove(int position, const QString &data) { EditOperation op; - op.m_position = position; - op.m_from = data; + op.position = position; + op.from = data; recordOperation(op); } @@ -1894,6 +1930,7 @@ void FakeVimHandler::Private::enterInsertMode() EDITOR(setOverwriteMode(false)); m_mode = InsertMode; m_lastInsertion.clear(); + recordBeginGroup(); } void FakeVimHandler::Private::enterCommandMode() diff --git a/src/plugins/find/currentdocumentfind.cpp b/src/plugins/find/currentdocumentfind.cpp index b51504db7dfe803545f1eace2b54be5063a9ebdb..7c9532eb17f29a4ef42bd0de8685f074ca870689 100644 --- a/src/plugins/find/currentdocumentfind.cpp +++ b/src/plugins/find/currentdocumentfind.cpp @@ -45,8 +45,8 @@ using namespace Core; using namespace Find; using namespace Find::Internal; -CurrentDocumentFind::CurrentDocumentFind(ICore *core) - : m_core(core), m_currentFind(0) +CurrentDocumentFind::CurrentDocumentFind() + : m_currentFind(0) { connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(updateCurrentFindFilter(QWidget*,QWidget*))); diff --git a/src/plugins/find/currentdocumentfind.h b/src/plugins/find/currentdocumentfind.h index 2f41acbe7b023fe2af9af03d8858e85089ed6af6..c5674db66325f6277cff1a594fabf288e953071d 100644 --- a/src/plugins/find/currentdocumentfind.h +++ b/src/plugins/find/currentdocumentfind.h @@ -36,8 +36,6 @@ #include "ifindfilter.h" -#include <coreplugin/icore.h> - #include <QtCore/QPointer> #include <QtGui/QWidget> @@ -49,7 +47,7 @@ class CurrentDocumentFind : public QObject Q_OBJECT public: - CurrentDocumentFind(Core::ICore *core); + CurrentDocumentFind(); void resetIncrementalSearch(); void clearResults(); @@ -83,7 +81,6 @@ private slots: private: void removeFindSupportConnections(); - Core::ICore *m_core; QPointer<IFindSupport> m_currentFind; QPointer<QWidget> m_currentWidget; }; diff --git a/src/plugins/find/findplugin.cpp b/src/plugins/find/findplugin.cpp index fb6c9c53b71477ff47b1420520f19f8c4063aa01..879acc7bda321b993582512d065db4b9a7b26214 100644 --- a/src/plugins/find/findplugin.cpp +++ b/src/plugins/find/findplugin.cpp @@ -42,6 +42,7 @@ #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/command.h> #include <coreplugin/coreconstants.h> +#include <coreplugin/icore.h> #include <extensionsystem/pluginmanager.h> @@ -77,14 +78,13 @@ FindPlugin::~FindPlugin() bool FindPlugin::initialize(const QStringList &, QString *) { - Core::ICore *core = Core::ICore::instance(); setupMenu(); - m_currentDocumentFind = new CurrentDocumentFind(core); + m_currentDocumentFind = new CurrentDocumentFind; m_findToolBar = new FindToolBar(this, m_currentDocumentFind); m_findDialog = new FindToolWindow(this); - SearchResultWindow *searchResultWindow = new SearchResultWindow(core); + SearchResultWindow *searchResultWindow = new SearchResultWindow; addAutoReleasedObject(searchResultWindow); return true; } @@ -126,8 +126,7 @@ void FindPlugin::openFindFilter() void FindPlugin::setupMenu() { - Core::ICore *core = Core::ICore::instance(); - Core::ActionManager *am = core->actionManager(); + Core::ActionManager *am = Core::ICore::instance()->actionManager(); Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT); Core::ActionContainer *mfind = am->createMenu(Constants::M_FIND); medit->addMenu(mfind, Core::Constants::G_EDIT_FIND); @@ -150,8 +149,7 @@ void FindPlugin::setupMenu() void FindPlugin::setupFilterMenuItems() { - Core::ICore *core = Core::ICore::instance(); - Core::ActionManager *am = core->actionManager(); + Core::ActionManager *am = Core::ICore::instance()->actionManager(); QList<IFindFilter*> findInterfaces = ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>(); Core::Command *cmd; diff --git a/src/plugins/find/findplugin.h b/src/plugins/find/findplugin.h index 9b2ac1f4aa637e40a4afa9163195ee076a40a4a6..28639476b950ef80afeebcc1f4256f71bf24a930 100644 --- a/src/plugins/find/findplugin.h +++ b/src/plugins/find/findplugin.h @@ -38,7 +38,6 @@ #include "ifindfilter.h" #include "findtoolbar.h" -#include <coreplugin/icore.h> #include <extensionsystem/iplugin.h> #include <QtCore/QHash> diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp index 5af25e496d4509fd09f968c93401d103ee885173..a8d9653160453488d20b987550c9ba27c241cd4a 100644 --- a/src/plugins/find/findtoolbar.cpp +++ b/src/plugins/find/findtoolbar.cpp @@ -37,6 +37,7 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/findplaceholder.h> +#include <coreplugin/icore.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/command.h> diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp index 57cd669515b6a2a49f6ac8d9d5de03990d6f0192..a979e9b39c9f691223ba22ec485284433301f3ae 100644 --- a/src/plugins/find/searchresultwindow.cpp +++ b/src/plugins/find/searchresultwindow.cpp @@ -34,6 +34,8 @@ #include "searchresultwindow.h" #include "searchresulttreemodel.h" +#include <coreplugin/icore.h> + #include <QtCore/QFile> #include <QtCore/QTextStream> #include <QtCore/QSettings> @@ -46,10 +48,9 @@ using namespace Find::Internal; static const QString SETTINGSKEYSECTIONNAME("SearchResults"); static const QString SETTINGSKEYEXPANDRESULTS("ExpandResults"); -SearchResultWindow::SearchResultWindow(Core::ICore *core) : - m_core(core), - m_widget(new QStackedWidget()) +SearchResultWindow::SearchResultWindow() { + m_widget = new QStackedWidget; m_widget->setWindowTitle(name()); m_searchResultTreeView = new SearchResultTreeView(m_widget); @@ -173,8 +174,8 @@ void SearchResultWindow::handleExpandCollapseToolButton(bool checked) void SearchResultWindow::readSettings(void) { - if (m_core && m_core->settings()) { - QSettings *s = m_core->settings(); + QSettings *s = Core::ICore::instance()->settings(); + if (s) { s->beginGroup(SETTINGSKEYSECTIONNAME); m_expandCollapseToolButton->setChecked(s->value(SETTINGSKEYEXPANDRESULTS, m_initiallyExpand).toBool()); s->endGroup(); @@ -183,8 +184,8 @@ void SearchResultWindow::readSettings(void) void SearchResultWindow::writeSettings(void) { - if (m_core && m_core->settings()) { - QSettings *s = m_core->settings(); + QSettings *s = Core::ICore::instance()->settings(); + if (s) { s->beginGroup(SETTINGSKEYSECTIONNAME); s->setValue(SETTINGSKEYEXPANDRESULTS, m_expandCollapseToolButton->isChecked()); s->endGroup(); diff --git a/src/plugins/find/searchresultwindow.h b/src/plugins/find/searchresultwindow.h index c167727ea057781db090c7f10ec75f432e7ba82d..e7923b5cc8c5628764dd19a10e924913f6a05d72 100644 --- a/src/plugins/find/searchresultwindow.h +++ b/src/plugins/find/searchresultwindow.h @@ -38,7 +38,6 @@ #include "searchresulttreeview.h" #include <coreplugin/ioutputpane.h> -#include <coreplugin/icore.h> #include <QtCore/QThread> #include <QtCore/QStringList> @@ -65,7 +64,7 @@ class FIND_EXPORT SearchResultWindow : public Core::IOutputPane Q_OBJECT public: - SearchResultWindow(Core::ICore *core); + SearchResultWindow(); ~SearchResultWindow(); QWidget *outputWidget(QWidget *); @@ -97,7 +96,6 @@ private: Internal::SearchResultTreeView *m_searchResultTreeView; QListWidget *m_noMatchesFoundDisplay; - Core::ICore *m_core; QToolButton *m_expandCollapseToolButton; static const bool m_initiallyExpand = false; QStackedWidget *m_widget; diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index f00f6d711eff9781c50c2ea50a588eb1bb60e234..11823909585901a621faa645e81e33634af047b6 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -236,8 +236,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message) m_gitClient = new GitClient(this); // Create the globalcontext list to register actions accordingly QList<int> globalcontext; - globalcontext << m_core->uniqueIDManager()-> - uniqueIdentifier(Core::Constants::C_GLOBAL); + globalcontext << m_core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_GLOBAL); // Create the output Window m_outputWindow = new GitOutputWindow(); diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index a22cc1f5105850a96bbde8088458938e069e67ee..9e07f46f69ffcafaeae916bee377f5ba195f225c 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -446,7 +446,7 @@ void HelpPlugin::extensionsInitialized() #if defined(Q_OS_MAC) + QLatin1String("/../Resources/doc/qtcreator.qch")); #else - + QLatin1String("/../doc/qtcreator.qch")); + + QLatin1String("../../share/doc/qtcreator/qtcreator.qch")); #endif QHelpEngineCore hc(fi.absoluteFilePath()); hc.setupData(); diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index cb93d8ed67763f18f9d4a3ff67b9087edec896f2..b17cb7e5b6ee775daa72a37708c66d7cab836684 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -241,8 +241,8 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess globalcontext << Core::Constants::C_GLOBAL_ID; QList<int> perforcesubmitcontext; - perforcesubmitcontext << - Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR); + perforcesubmitcontext << Core::UniqueIDManager::instance()-> + uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR); Core::Command *command; QAction *tmpaction; @@ -467,7 +467,7 @@ void PerforcePlugin::diffAllOpened() void PerforcePlugin::printOpenedFileList() { - Core::IEditor *e = Core::ICore::instance()->editorManager()->currentEditor(); + Core::IEditor *e = Core::EditorManager::instance()->currentEditor(); if (e) e->widget()->setFocus(); PerforceResponse result = runP4Cmd(QStringList() << QLatin1String("opened"), QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); @@ -542,9 +542,9 @@ void PerforcePlugin::submit() Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames) { - Core::IEditor *editor = - Core::ICore::instance()->editorManager()->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND); - Core::ICore::instance()->editorManager()->ensureEditorManagerVisible(); + Core::EditorManager *editorManager = Core::EditorManager::instance(); + Core::IEditor *editor = editorManager->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND); + editorManager->ensureEditorManagerVisible(); PerforceSubmitEditor *submitEditor = dynamic_cast<PerforceSubmitEditor*>(editor); QTC_ASSERT(submitEditor, return 0); submitEditor->restrictToProjectFiles(depotFileNames); @@ -841,9 +841,9 @@ Core::IEditor * PerforcePlugin::showOutputInEditor(const QString& title, const Q if (Perforce::Constants::debug) qDebug() << "PerforcePlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); QString s = title; - Core::IEditor *ediface = Core::ICore::instance()->editorManager()-> + Core::IEditor *editor = Core::EditorManager::instance()-> newFile(kind, &s, output.toLocal8Bit()); - PerforceEditor *e = qobject_cast<PerforceEditor*>(ediface->widget()); + PerforceEditor *e = qobject_cast<PerforceEditor*>(editor->widget()); if (!e) return 0; s.replace(QLatin1Char(' '), QLatin1Char('_')); @@ -857,7 +857,7 @@ QStringList PerforcePlugin::environment() const { QStringList newEnv = QProcess::systemEnvironment(); const QString name = "P4DIFF"; - for (int i=0; i<newEnv.count(); ++i) { + for (int i = 0; i < newEnv.count(); ++i) { if (newEnv.at(i).startsWith(name)) { newEnv.removeAt(i); return newEnv; @@ -889,7 +889,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname) diffname = fi.fileName(); } - foreach (Core::IEditor *ed, Core::ICore::instance()->editorManager()->openedEditors()) { + foreach (Core::IEditor *ed, Core::EditorManager::instance()->openedEditors()) { if (ed->file()->property("originalFileName").toString() == fileName) { existingEditor = ed; displayInEditor = false; @@ -912,7 +912,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname) } else if (!displayInEditor && existingEditor) { if (existingEditor) { existingEditor->createNew(result.stdOut); - Core::ICore::instance()->editorManager()->setCurrentEditor(existingEditor); + Core::EditorManager::instance()->setCurrentEditor(existingEditor); } } } @@ -930,7 +930,7 @@ void PerforcePlugin::describe(const QString & source, const QString &n) void PerforcePlugin::submitCurrentLog() { - Core::EditorManager *em = Core::ICore::instance()->editorManager(); + Core::EditorManager *em = Core::EditorManager::instance(); em->closeEditors(QList<Core::IEditor*>() << em->currentEditor()); } @@ -1004,8 +1004,8 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor) void PerforcePlugin::openFiles(const QStringList &files) { - Core::EditorManager *em = Core::ICore::instance()->editorManager(); - foreach (QString s, files) + Core::EditorManager *em = Core::EditorManager::instance(); + foreach (const QString &s, files) em->openEditor(clientFilePath(s)); em->ensureEditorManagerVisible(); } diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index a7e7286a30f6b18acfa823a3a9d98be333737107..d5a1911a3349840b57ff9ca3843cef746cb5879b 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -40,6 +40,7 @@ #include "projectexplorer.h" #include "taskwindow.h" +#include <coreplugin/icore.h> #include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/futureprogress.h> #include <extensionsystem/pluginmanager.h> diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 1cb9979538c9e9e386f7148c5fb48c68b9c5583a..29b0fbe1cd1da1f8e85e4669c29a20f88656a914 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -170,7 +170,7 @@ void FolderNavigationWidget::openItem(const QModelIndex &index) setCurrentTitle(QDir(m_dirModel->filePath(srcIndex))); } else { const QString filePath = m_dirModel->filePath(srcIndex); - Core::EditorManager *editorManager = Core::ICore::instance()->editorManager(); + Core::EditorManager *editorManager = Core::EditorManager::instance(); editorManager->openEditor(filePath); editorManager->ensureEditorManagerVisible(); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index bab8e67b3b9a5905182bf41e9999cabdcc3cc23a..6b95e6de02be52de8eeb6d9b2e7f03c7e4586f16 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -62,9 +62,10 @@ #include <coreplugin/basemode.h> #include <coreplugin/coreconstants.h> +#include <coreplugin/filemanager.h> +#include <coreplugin/icore.h> #include <coreplugin/mainwindow.h> #include <coreplugin/mimedatabase.h> -#include <coreplugin/filemanager.h> #include <coreplugin/modemanager.h> #include <coreplugin/uniqueidmanager.h> #include <coreplugin/actionmanager/actionmanager.h> @@ -871,7 +872,7 @@ bool ProjectExplorerPlugin::openProjects(const QStringList &fileNames) updateActions(); - Core::ICore::instance()->modeManager()->activateMode(Core::Constants::MODE_EDIT); + Core::ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT); QApplication::restoreOverrideCursor(); return true; @@ -987,7 +988,7 @@ void ProjectExplorerPlugin::restoreSession() } // update welcome page - Core::ModeManager *modeManager = Core::ICore::instance()->modeManager(); + Core::ModeManager *modeManager = Core::ModeManager::instance(); connect(modeManager, SIGNAL(currentModeChanged(Core::IMode*)), this, SLOT(currentModeChanged(Core::IMode*))); if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*>(modeManager->mode(Core::Constants::MODE_WELCOME))) { updateWelcomePage(welcomeMode); @@ -1619,9 +1620,9 @@ void ProjectExplorerPlugin::openFile() { if (m_currentNode) return; - Core::ICore *core = Core::ICore::instance(); - core->editorManager()->openEditor(m_currentNode->path()); - core->editorManager()->ensureEditorManagerVisible(); + Core::EditorManager *em = Core::EditorManager::instance(); + em->openEditor(m_currentNode->path()); + em->ensureEditorManagerVisible(); } void ProjectExplorerPlugin::removeFile() @@ -1803,7 +1804,7 @@ void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action) qWarning() << "Editor Factory not attached to action, can't happen"<<editorFactory; return; } - Core::EditorManager *em = Core::ICore::instance()->editorManager(); + Core::EditorManager *em = Core::EditorManager::instance(); em->openEditor(currentNode()->path(), editorFactory->kind()); em->ensureEditorManagerVisible(); } diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index f0357dcf3eba68b4aa81b36f49429fc9f7b99b8b..ad923b3991b69d178301575d3f10e11e1a8a0fbd 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -286,7 +286,7 @@ void ProjectTreeWidget::openItem(const QModelIndex &mainIndex) { Node *node = m_model->nodeForIndex(mainIndex); if (node->nodeType() == FileNodeType) { - Core::EditorManager *editorManager = Core::ICore::instance()->editorManager(); + Core::EditorManager *editorManager = Core::EditorManager::instance(); editorManager->openEditor(node->path()); editorManager->ensureEditorManagerVisible(); } diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 03243abb5ca1a9f74aff29e1ca388e59133a3539..9bc28fda44c1447da8070caa843931646f91477c 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -37,6 +37,7 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/coreconstants.h> +#include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <extensionsystem/pluginmanager.h> #include <texteditor/itexteditor.h> @@ -578,8 +579,8 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, TaskWindowContext::TaskWindowContext(QWidget *widget) : m_taskList(widget) { - Core::ICore *core = Core::ICore::instance(); - m_context << core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE); + Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); + m_context << uidm->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE); } QList<int> TaskWindowContext::context() const diff --git a/src/plugins/projectexplorer/taskwindow.h b/src/plugins/projectexplorer/taskwindow.h index 269f6e3ce6201c8bed8c565631b957bde756a7d9..0f2db145e367a6be16642b772116e0d398a56e6e 100644 --- a/src/plugins/projectexplorer/taskwindow.h +++ b/src/plugins/projectexplorer/taskwindow.h @@ -38,7 +38,6 @@ #include <coreplugin/ioutputpane.h> #include <coreplugin/icontext.h> -#include <coreplugin/icore.h> #include <QtGui/QTreeWidget> #include <QtGui/QStyledItemDelegate> diff --git a/src/plugins/qt4projectmanager/profileeditor.cpp b/src/plugins/qt4projectmanager/profileeditor.cpp index 12750868c4b4a48c176def4bbb3de83b664e219e..3cab2eaaca5c06ce4c9629a60bb76333e2b9973a 100644 --- a/src/plugins/qt4projectmanager/profileeditor.cpp +++ b/src/plugins/qt4projectmanager/profileeditor.cpp @@ -40,7 +40,6 @@ #include "proeditormodel.h" #include "procommandmanager.h" -#include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <texteditor/fontsettings.h> #include <texteditor/texteditoractionhandler.h> @@ -62,13 +61,10 @@ using namespace ProjectExplorer; ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor) : BaseTextEditorEditable(editor) { - Core::ICore *core = Core::ICore::instance(); - m_context << core->uniqueIDManager()-> - uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR); - m_context << core->uniqueIDManager()-> - uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); -// m_contexts << core->uniqueIDManager()-> -// uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND); + Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); + m_context << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR); + m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); +// m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND); } TextEditor::BaseTextEditorEditable *ProFileEditor::createEditableInterface() diff --git a/src/plugins/qt4projectmanager/profileeditorfactory.cpp b/src/plugins/qt4projectmanager/profileeditorfactory.cpp index b3d32a025e4862275f5eda96b52e349aaafa8eb5..21299bb2feae79771dc1dfa34a22eaecb97904b5 100644 --- a/src/plugins/qt4projectmanager/profileeditorfactory.cpp +++ b/src/plugins/qt4projectmanager/profileeditorfactory.cpp @@ -37,7 +37,6 @@ #include "qt4projectmanagerconstants.h" #include "profileeditor.h" -#include <coreplugin/icore.h> #include <coreplugin/fileiconprovider.h> #include <coreplugin/editormanager/editormanager.h> #include <texteditor/texteditoractionhandler.h> @@ -74,8 +73,7 @@ QString ProFileEditorFactory::kind() const Core::IFile *ProFileEditorFactory::open(const QString &fileName) { - Core::ICore *core = Core::ICore::instance(); - Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind()); + Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind()); return iface ? iface->file() : 0; } diff --git a/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp index 46d5b106f5cf41bfad75b01cd39b06dc8b39e218..d473e1dc75cf320daa96ebb5a3295ce4349f436e 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp +++ b/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp @@ -40,6 +40,7 @@ #include "qt4projectmanager.h" #include "ui_qt4buildconfigwidget.h" +#include <coreplugin/icore.h> #include <coreplugin/mainwindow.h> #include <QtGui/QFileDialog> diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index 8d44d81df20c0b9c3f0fee38eeab28ea44c03bf9..4356b0b536e80e69fe78b23ab667bb37b260ee63 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -89,8 +89,8 @@ Qt4Manager::Qt4Manager(Qt4ProjectManagerPlugin *plugin) m_contextProject(0), m_languageID(0) { - m_languageID = Core::ICore::instance()->uniqueIDManager()-> - uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX); + m_languageID = Core::UniqueIDManager::instance()-> + uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX); } Qt4Manager::~Qt4Manager() diff --git a/src/plugins/qtscripteditor/qtscripteditorfactory.cpp b/src/plugins/qtscripteditor/qtscripteditorfactory.cpp index 9e169648f128b92b55140fa3cb18825d6d7f832b..1f776d8df0829285373c5c88a54a55560b405eae 100644 --- a/src/plugins/qtscripteditor/qtscripteditorfactory.cpp +++ b/src/plugins/qtscripteditor/qtscripteditorfactory.cpp @@ -37,7 +37,6 @@ #include "qtscripteditorconstants.h" #include "qtscripteditorplugin.h" -#include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> #include <QtCore/QFileInfo> @@ -67,7 +66,7 @@ QString QtScriptEditorFactory::kind() const Core::IFile *QtScriptEditorFactory::open(const QString &fileName) { - Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind()); + Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind()); if (!iface) { qWarning() << "QtScriptEditorFactory::open: openEditor failed for " << fileName; return 0; diff --git a/src/plugins/quickopen/basefilefilter.cpp b/src/plugins/quickopen/basefilefilter.cpp index 147cd5b07d14b7b45209d2004775737f2cb176bf..8bd10cd4a6bd84586f9cd63f1684b45a1ef42970 100644 --- a/src/plugins/quickopen/basefilefilter.cpp +++ b/src/plugins/quickopen/basefilefilter.cpp @@ -33,7 +33,6 @@ #include "basefilefilter.h" -#include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> #include <QtCore/QDir> @@ -89,7 +88,7 @@ QList<FilterEntry> BaseFileFilter::matchesFor(const QString &origEntry) void BaseFileFilter::accept(QuickOpen::FilterEntry selection) const { - Core::EditorManager *em = Core::ICore::instance()->editorManager(); + Core::EditorManager *em = Core::EditorManager::instance(); em->openEditor(selection.internalData.toString()); em->ensureEditorManagerVisible(); } diff --git a/src/plugins/quickopen/filesystemfilter.h b/src/plugins/quickopen/filesystemfilter.h index c935b9fb2c37b8db579df9197ba841258e01dccf..ef7aebd41f49e732c99e660286ff4d009910e5cc 100644 --- a/src/plugins/quickopen/filesystemfilter.h +++ b/src/plugins/quickopen/filesystemfilter.h @@ -37,7 +37,6 @@ #include "iquickopenfilter.h" #include "ui_filesystemfilter.h" -#include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> #include <QtCore/QString> diff --git a/src/plugins/quickopen/quickopenplugin.cpp b/src/plugins/quickopen/quickopenplugin.cpp index 0abebe3a88f7528c7d763a9c2f2f879d9463a7cf..aab8bf739bec660f9ce33234601663ed074abb6c 100644 --- a/src/plugins/quickopen/quickopenplugin.cpp +++ b/src/plugins/quickopen/quickopenplugin.cpp @@ -47,9 +47,10 @@ #include <coreplugin/baseview.h> #include <coreplugin/coreconstants.h> +#include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> -#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/actionmanager/actionmanager.h> +#include <coreplugin/progressmanager/progressmanager.h> #include <extensionsystem/pluginmanager.h> #include <qtconcurrent/QtConcurrentTools> diff --git a/src/plugins/quickopen/settingspage.h b/src/plugins/quickopen/settingspage.h index ddd1d5e28880fc14a293da9ca6c51bbccb204222..9bd0971a049b3791c3b1655c11cdd6db72c6adf4 100644 --- a/src/plugins/quickopen/settingspage.h +++ b/src/plugins/quickopen/settingspage.h @@ -41,7 +41,6 @@ #include <QtCore/QHash> #include <coreplugin/dialogs/ioptionspage.h> -#include <coreplugin/icore.h> QT_BEGIN_NAMESPACE class QListWidgetItem; diff --git a/src/plugins/resourceeditor/resourceeditorfactory.cpp b/src/plugins/resourceeditor/resourceeditorfactory.cpp index 658a572c3949b5ae867aa35531f8ab3f1290cf53..dcdd691c9fc8afc209ce030cdb28b611ac2f717a 100644 --- a/src/plugins/resourceeditor/resourceeditorfactory.cpp +++ b/src/plugins/resourceeditor/resourceeditorfactory.cpp @@ -36,7 +36,6 @@ #include "resourceeditorplugin.h" #include "resourceeditorconstants.h" -#include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <coreplugin/fileiconprovider.h> #include <coreplugin/editormanager/editormanager.h> @@ -53,7 +52,7 @@ ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) : m_kind(QLatin1String(C_RESOURCEEDITOR)), m_plugin(plugin) { - m_context += Core::ICore::instance()->uniqueIDManager() + m_context += Core::UniqueIDManager::instance() ->uniqueIdentifier(QLatin1String(ResourceEditor::Constants::C_RESOURCEEDITOR)); Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance(); iconProvider->registerIconForSuffix(QIcon(":/resourceeditor/images/qt_qrc.png"), @@ -67,7 +66,7 @@ QString ResourceEditorFactory::kind() const Core::IFile *ResourceEditorFactory::open(const QString &fileName) { - Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind()); + Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind()); if (!iface) { qWarning() << "ResourceEditorFactory::open: openEditor failed for " << fileName; return 0; diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 7e5a7dcd1f8b853178080e25dcce868ba130fe3a..117ccedfbd7f85cdb10631c975f98cec64b1b472 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -129,7 +129,7 @@ void ResourceEditorPlugin::onUndoStackChanged(ResourceEditorW const *editor, ResourceEditorW * ResourceEditorPlugin::currentEditor() const { ResourceEditorW * const focusEditor = qobject_cast<ResourceEditorW *>( - Core::ICore::instance()->editorManager()->currentEditor()); + Core::EditorManager::instance()->currentEditor()); QTC_ASSERT(focusEditor, return 0); return focusEditor; } diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 4d10297d9b9181584d700f48b4d167893db08f0e..7f6ea476eb29d12fd27ae5f74102fa476757c97b 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -134,7 +134,7 @@ static inline QString debugCodec(const QTextCodec *c) Core::IEditor* locateEditor(const char *property, const QString &entry) { - foreach (Core::IEditor *ed, Core::ICore::instance()->editorManager()->openedEditors()) + foreach (Core::IEditor *ed, Core::EditorManager::instance()->openedEditors()) if (ed->property(property).toString() == entry) return ed; return 0; @@ -407,7 +407,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe // Actions of the submit editor QList<int> svncommitcontext; - svncommitcontext << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR); + svncommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR); m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this); command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext); @@ -513,7 +513,7 @@ void SubversionPlugin::svnDiff(const QStringList &files, QString diffname) // Show in the same editor if diff has been executed before if (Core::IEditor *editor = locateEditor("originalFileName", files.front())) { editor->createNew(response.stdOut); - Core::ICore::instance()->editorManager()->setCurrentEditor(editor); + Core::EditorManager::instance()->setCurrentEditor(editor); return; } } @@ -525,7 +525,7 @@ void SubversionPlugin::svnDiff(const QStringList &files, QString diffname) SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QString &fileName) { - Core::IEditor *editor = Core::ICore::instance()->editorManager()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND)); + Core::IEditor *editor = Core::EditorManager::instance()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND)); SubversionSubmitEditor *submitEditor = qobject_cast<SubversionSubmitEditor*>(editor); QTC_ASSERT(submitEditor, /**/); submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction); @@ -776,7 +776,7 @@ void SubversionPlugin::filelog(const QString &file) if (Core::IEditor *editor = locateEditor("logFileName", file)) { editor->createNew(response.stdOut); - Core::ICore::instance()->editorManager()->setCurrentEditor(editor); + Core::EditorManager::instance()->setCurrentEditor(editor); } else { const QString title = tr("svn log %1").arg(QFileInfo(file).fileName()); Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::LogOutput, file, codec); @@ -819,7 +819,7 @@ void SubversionPlugin::annotate(const QString &file) if (Core::IEditor *editor = locateEditor("annotateFileName", file)) { editor->createNew(response.stdOut); - Core::ICore::instance()->editorManager()->setCurrentEditor(editor); + Core::EditorManager::instance()->setCurrentEditor(editor); } else { const QString title = tr("svn annotate %1").arg(QFileInfo(file).fileName()); Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, file, codec); @@ -873,7 +873,7 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr) const QString id = diffArg + source; if (Core::IEditor *editor = locateEditor("describeChange", id)) { editor->createNew(response.stdOut); - Core::ICore::instance()->editorManager()->setCurrentEditor(editor); + Core::EditorManager::instance()->setCurrentEditor(editor); } else { const QString title = tr("svn describe %1#%2").arg(QFileInfo(source).fileName(), changeNr); Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::DiffOutput, source, codec); @@ -883,8 +883,8 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr) void SubversionPlugin::submitCurrentLog() { - Core::ICore::instance()->editorManager()->closeEditors(QList<Core::IEditor*>() - << Core::ICore::instance()->editorManager()->currentEditor()); + Core::EditorManager::instance()->closeEditors(QList<Core::IEditor*>() + << Core::EditorManager::instance()->currentEditor()); } QString SubversionPlugin::currentFileName() const @@ -990,8 +990,8 @@ Core::IEditor * SubversionPlugin::showOutputInEditor(const QString& title, const if (Subversion::Constants::debug) qDebug() << "SubversionPlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); QString s = title; - Core::IEditor *ediface = Core::ICore::instance()->editorManager()->newFile(kind, &s, output.toLocal8Bit()); - SubversionEditor *e = qobject_cast<SubversionEditor*>(ediface->widget()); + Core::IEditor *editor = Core::EditorManager::instance()->newFile(kind, &s, output.toLocal8Bit()); + SubversionEditor *e = qobject_cast<SubversionEditor*>(editor->widget()); if (!e) return 0; s.replace(QLatin1Char(' '), QLatin1Char('_')); diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index e574140d3d8eff399c7c81f1dd513b61b0985880..36295979d1dc7b60d782f4551a3e9e67926ea208 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -33,6 +33,7 @@ #include "basefilefind.h" +#include <coreplugin/icore.h> #include <coreplugin/stylehelper.h> #include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/editormanager/editormanager.h> @@ -40,7 +41,7 @@ #include <texteditor/itexteditor.h> #include <texteditor/basetexteditor.h> -#include <QtDebug> +#include <QtCore/QDebug> #include <QtCore/QDirIterator> #include <QtGui/QPushButton> #include <QtGui/QFileDialog> diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index cae7df6bd7d58d0f0dda146f2436bd621e830824..0e058ff752e1635b472cae29a82070d4abeaa7e9 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -43,7 +43,6 @@ #include "codecselector.h" #ifndef TEXTEDITOR_STANDALONE -#include <coreplugin/icore.h> #include <coreplugin/manhattanstyle.h> #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> @@ -132,7 +131,7 @@ ITextEditor *BaseTextEditor::openEditorAt(const QString &fileName, int column, const QString &editorKind) { - Core::EditorManager *editorManager = Core::ICore::instance()->editorManager(); + Core::EditorManager *editorManager = Core::EditorManager::instance(); editorManager->addCurrentPositionToNavigationHistory(true); Core::IEditor *editor = editorManager->openEditor(fileName, editorKind, true); TextEditor::ITextEditor *texteditor = qobject_cast<TextEditor::ITextEditor *>(editor); diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp index c5db69325657e50643a59d1408cd0e9a6ae97458..b6ec76b7ddc84707d05a462d10e1e633c004b46b 100644 --- a/src/plugins/texteditor/basetextmark.cpp +++ b/src/plugins/texteditor/basetextmark.cpp @@ -35,7 +35,6 @@ #include <coreplugin/editormanager/editormanager.h> #include <extensionsystem/pluginmanager.h> -#include <coreplugin/icore.h> #include <QtCore/QTimer> @@ -57,7 +56,7 @@ BaseTextMark::BaseTextMark(const QString &filename, int line) void BaseTextMark::init() { m_init = true; - Core::EditorManager *em = Core::ICore::instance()->editorManager(); + Core::EditorManager *em = Core::EditorManager::instance(); connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *))); foreach (Core::IEditor *editor, em->openedEditors()) @@ -117,7 +116,7 @@ void BaseTextMark::updateMarker() void BaseTextMark::moveMark(const QString & /* filename */, int /* line */) { - Core::EditorManager *em = Core::ICore::instance()->editorManager(); + Core::EditorManager *em = Core::EditorManager::instance(); if (!m_init) { connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *))); m_init = true; diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp index 4a76df107660f35269e9c084f07ace2e01add38c..f4fbe12aa8c4f470025cac96a6b9098e7009fe45 100644 --- a/src/plugins/texteditor/plaintexteditor.cpp +++ b/src/plugins/texteditor/plaintexteditor.cpp @@ -36,24 +36,21 @@ #include "texteditorplugin.h" #include <coreplugin/coreconstants.h> -#include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> using namespace TextEditor; using namespace TextEditor::Internal; PlainTextEditorEditable::PlainTextEditorEditable(PlainTextEditor *editor) - :BaseTextEditorEditable(editor) + : BaseTextEditorEditable(editor) { - Core::ICore *core = Core::ICore::instance(); - m_context << core->uniqueIDManager()-> - uniqueIdentifier(Core::Constants::K_DEFAULT_TEXT_EDITOR); - m_context << core->uniqueIDManager()-> - uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); + Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); + m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_TEXT_EDITOR); + m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); } -PlainTextEditor::PlainTextEditor(QWidget *parent) : - BaseTextEditor(parent) +PlainTextEditor::PlainTextEditor(QWidget *parent) + : BaseTextEditor(parent) { setRevisionsVisible(true); setMarksVisible(true); diff --git a/src/plugins/texteditor/plaintexteditorfactory.cpp b/src/plugins/texteditor/plaintexteditorfactory.cpp index 7c63855ec7a74c4880e176f6f58fa8c9e4ea1089..8fc40ac703f936fa42fbfe43ebcb38bdda370620 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.cpp +++ b/src/plugins/texteditor/plaintexteditorfactory.cpp @@ -37,7 +37,6 @@ #include "texteditorplugin.h" #include "texteditoractionhandler.h" -#include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> @@ -67,8 +66,7 @@ QString PlainTextEditorFactory::kind() const Core::IFile *PlainTextEditorFactory::open(const QString &fileName) { - Core::ICore *core = Core::ICore::instance(); - Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind()); + Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind()); return iface ? iface->file() : 0; } diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 511e1d919e7dfa130c7a21130405ec86821ae5ff..5ff46ef1353f94174ff13db0d390ba93fe070004 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -89,7 +89,7 @@ TextEditorActionHandler::TextEditorActionHandler(const QString &context, m_moveLineUpAction = 0; m_moveLineDownAction = 0; - m_contextId << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(context); + m_contextId << Core::UniqueIDManager::instance()->uniqueIdentifier(context); connect(Core::ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext *)), this, SLOT(updateCurrentEditor(Core::IContext *))); diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 23b96a5321762269ecc7edfae935b60d987098a7..1e6a47e47d4a56d7e1ff0b6117659813d3135e14 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -43,6 +43,7 @@ #include "plaintexteditor.h" #include "storagesettings.h" +#include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> #include <coreplugin/mimedatabase.h> #include <coreplugin/uniqueidmanager.h> @@ -166,7 +167,7 @@ void TextEditorPlugin::initializeEditor(TextEditor::PlainTextEditor *editor) void TextEditorPlugin::invokeCompletion() { - Core::IEditor *iface = Core::ICore::instance()->editorManager()->currentEditor(); + Core::IEditor *iface = Core::EditorManager::instance()->currentEditor(); ITextEditor *editor = qobject_cast<ITextEditor *>(iface); if (editor) editor->triggerCompletions(); diff --git a/src/plugins/vcsbase/basevcseditorfactory.cpp b/src/plugins/vcsbase/basevcseditorfactory.cpp index edfadc7032a27da683f68b32ef207e27cf73e5a2..d7f85a9449d2ce4389bd597ba5562a06f676b22a 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.cpp +++ b/src/plugins/vcsbase/basevcseditorfactory.cpp @@ -35,7 +35,6 @@ #include "vcsbaseplugin.h" #include "vcsbaseeditor.h" -#include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> #include <texteditor/fontsettings.h> #include <texteditor/texteditoractionhandler.h> @@ -83,7 +82,7 @@ QString BaseVCSEditorFactory::kind() const Core::IFile *BaseVCSEditorFactory::open(const QString &fileName) { - Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind()); + Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind()); return iface ? iface->file() : 0; } diff --git a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp index f4610ed668563ae756724c84b5c2cc53a854645d..616f27794a392e3fd858e8708da12b63d588c6b9 100644 --- a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp +++ b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp @@ -34,7 +34,6 @@ #include "basevcssubmiteditorfactory.h" #include "vcsbasesubmiteditor.h" -#include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> namespace VCSBase { @@ -82,8 +81,7 @@ QStringList BaseVCSSubmitEditorFactory::mimeTypes() const Core::IFile *BaseVCSSubmitEditorFactory::open(const QString &fileName) { - Core::ICore *core = Core::ICore::instance(); - if (Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind())) + if (Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind())) return iface->file(); return 0; } diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 7cf2f2a9a4ee1564b8f9186918ac3a9a6f822ce0..5a4e02dd81eaf4fc6eed60fbf2e634659ed0515e 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -38,7 +38,6 @@ #include "vcsbaseconstants.h" #include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <extensionsystem/pluginmanager.h> #include <projectexplorer/editorconfiguration.h> @@ -85,10 +84,9 @@ VCSBaseEditorEditable::VCSBaseEditorEditable(VCSBaseEditor *editor, const VCSBaseEditorParameters *type) : BaseTextEditorEditable(editor), m_kind(type->kind) { - Core::ICore *core = Core::ICore::instance(); - m_context << core->uniqueIDManager()->uniqueIdentifier(QLatin1String(type->context)) - << core->uniqueIDManager()->uniqueIdentifier(QLatin1String(TextEditor::Constants::C_TEXTEDITOR)); - + Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); + m_context << uidm->uniqueIdentifier(QLatin1String(type->context)) + << uidm->uniqueIdentifier(QLatin1String(TextEditor::Constants::C_TEXTEDITOR)); } QList<int> VCSBaseEditorEditable::context() const @@ -363,7 +361,7 @@ void VCSBaseEditor::jumpToChangeFromDiff(QTextCursor cursor) if (!exists) return; - Core::EditorManager *em = Core::ICore::instance()->editorManager(); + Core::EditorManager *em = Core::EditorManager::instance(); Core::IEditor *ed = em->openEditor(fileName); em->ensureEditorManagerVisible(); if (TextEditor::ITextEditor *editor = qobject_cast<TextEditor::ITextEditor *>(ed)) @@ -409,8 +407,7 @@ static QTextCodec *findFileCodec(const QString &source) { typedef QList<Core::IEditor *> EditorList; - const EditorList editors = - Core::ICore::instance()->editorManager()->editorsForFileName(source); + const EditorList editors = Core::EditorManager::instance()->editorsForFileName(source); if (!editors.empty()) { const EditorList::const_iterator ecend = editors.constEnd(); for (EditorList::const_iterator it = editors.constBegin(); it != ecend; ++it) diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 64192d1b6b4382017856090d3a6c935baf948b60..16636aaedb276483657ffcbfe58ab07b746f7093 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -35,7 +35,6 @@ #include "submiteditorfile.h" #include <coreplugin/ifile.h> -#include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <coreplugin/actionmanager/actionmanager.h> #include <extensionsystem/pluginmanager.h> @@ -84,7 +83,7 @@ VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditor m_parameters(parameters), m_file(new VCSBase::Internal::SubmitEditorFile(QLatin1String(m_parameters->mimeType), q)) { - m_contexts << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(m_parameters->context); + m_contexts << Core::UniqueIDManager::instance()->uniqueIdentifier(m_parameters->context); } VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters, diff --git a/src/qworkbench.pri b/src/qworkbench.pri index 1f84296084255cab76f64eda83f120e353738ebe..296e2170b3dcde2b057a6a4a78001a22784f7213 100644 --- a/src/qworkbench.pri +++ b/src/qworkbench.pri @@ -15,12 +15,14 @@ isEmpty(IDE_BUILD_TREE) { error("qworkbench.pri: including file must define IDE_BUILD_TREE (probably a relative path)") } macx { - IDE_APP_TARGET = QtCreator + IDE_APP_TARGET = QtCreator IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/bin/$${IDE_APP_TARGET}.app/Contents/PlugIns + IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH contains(QT_CONFIG, ppc):CONFIG += ppc x86 } else { - IDE_APP_TARGET = qtcreator - IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/lib + IDE_APP_TARGET = qtcreator + IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/lib/qtcreator + IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH/plugins/ } IDE_APP_PATH = $$IDE_BUILD_TREE/bin win32 { diff --git a/src/qworkbenchlibrary.pri b/src/qworkbenchlibrary.pri index 1ef9b3fbec49d3c1de32988a9008f4f1361164f4..389d513eec9da9d5ae6dc08ff571f62918b873c7 100644 --- a/src/qworkbenchlibrary.pri +++ b/src/qworkbenchlibrary.pri @@ -7,16 +7,13 @@ win32 { DESTDIR = $$IDE_LIBRARY_PATH -macx { - QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../PlugIns/ -} else:linux-* { - #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR - QMAKE_RPATHDIR += \$\$ORIGIN - IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") - QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\' - QMAKE_RPATHDIR = -} +include(../rpath.pri) TARGET = $$qtLibraryTarget($$TARGET) contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols + +linux-* { + target.path = /lib/qtcreator + INSTALLS += target + } diff --git a/src/qworkbenchplugin.pri b/src/qworkbenchplugin.pri index e598570259aa4612c73f69e4a48ad7a14495139d..25e02ae4747ff09007d473fe87921d005a603016 100644 --- a/src/qworkbenchplugin.pri +++ b/src/qworkbenchplugin.pri @@ -7,7 +7,7 @@ isEmpty(PROVIDER) { PROVIDER = Nokia } -DESTDIR = $$IDE_LIBRARY_PATH/$$PROVIDER/ +DESTDIR = $$IDE_PLUGIN_PATH/$$PROVIDER/ LIBS += -L$$DESTDIR INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins DEPENDPATH += $$IDE_SOURCE_TREE/src/plugins @@ -40,7 +40,9 @@ macx { QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../PlugIns/$${PROVIDER}/ } else:linux-* { #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR + QMAKE_RPATHDIR += \$\$ORIGIN QMAKE_RPATHDIR += \$\$ORIGIN/.. + QMAKE_RPATHDIR += \$\$ORIGIN/../.. IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\' QMAKE_RPATHDIR = @@ -48,3 +50,12 @@ macx { contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols + +CONFIG += plugin + +linux-* { + target.path = /lib/qtcreator/plugins/$$PROVIDER + pluginspec.files += $${TARGET}.pluginspec + pluginspec.path = /lib/qtcreator/plugins/$$PROVIDER + INSTALLS += target pluginspec +} diff --git a/src/rpath.pri b/src/rpath.pri new file mode 100644 index 0000000000000000000000000000000000000000..e6812dbc23adbac03d151f404c1ead0468fee14d --- /dev/null +++ b/src/rpath.pri @@ -0,0 +1,13 @@ +macx { + QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../PlugIns/ +} else:linux-* { + #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR + # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var + QMAKE_RPATHDIR += \$\$ORIGIN/../lib/qtcreator + IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") + + QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\' + QMAKE_RPATHDIR = +} + + diff --git a/src/tools/qtlibspatcher/binpatch.cpp b/src/tools/qtlibspatcher/binpatch.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e2fd4cc2f2e392212455c1c36bd773b665bf6cbd --- /dev/null +++ b/src/tools/qtlibspatcher/binpatch.cpp @@ -0,0 +1,210 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#include <cstdio> +#include <cstring> +#include <locale> + +#include "binpatch.h" + +// returns positive value if it finds a null termination inside the buffer +long BinPatch::getBufferStringLength(char *data, char *end) +{ + long size = 0; + while (data < end) { + if (*data == '\0') + return size; + ++data; + ++size; + } + + return -1; +} + +// returns true if data ends with one of the tokens. (Sep. with ;) +bool BinPatch::endsWithTokens(const char *data) +{ + if(strlen(endTokens) > 0) { + char endstmp[1024]; + ulong tlen = ulong(strlen(data)); + + if(strlen(endTokens) >= sizeof(endstmp)) + return false; + + strcpy(endstmp, endTokens); + + char *token = strtok(endstmp, ";"); + + while(token != NULL) { + // check if it ends with the token + if ((tlen >= strlen(token)) + && (strcasecmp((data+tlen)-strlen(token), token) == 0)) + return true; + token = strtok(NULL, ";"); + } + } else { + return true; //true if no tokens + } + + return false; //no matching tokens +} + +bool BinPatch::patchHelper(char *inbuffer, const char *oldstr, const char *newstr, size_t len, long *rw) +{ + char nc1 = *oldstr; + char nc2 = 0; + char *inend = inbuffer + len; + size_t oldlen = strlen(oldstr); + size_t newlen = strlen(newstr); + char *instart = inbuffer; + *rw = 0; + bool write = true; + + isupper(nc1) ? nc2 = tolower(nc1) : nc2 = toupper(nc1); + + while(inbuffer < inend) { + if ((*inbuffer == nc1) || (*inbuffer == nc2)) { + if (inbuffer > (inend-oldlen) || inbuffer > (inend-newlen)) { + *rw = (long)(inend-inbuffer); //rewind, not enough to make a compare + break; + } + + if (strncasecmp(inbuffer, oldstr, oldlen) == 0) { + if (useLength && (instart == inbuffer)) { + *rw = (long)(len+1); //we don't have access to the length byte, rewind all + 1! + write = false; + break; + } + + long oldsize = -1; + if (useLength) { //VC60 + oldsize = (unsigned char)(*(inbuffer-1)); + + // vc60 pdb files sometimes uses 0A, then it should be null terminated + if (oldsize < (long)oldlen) { + if (oldsize != 0x0A) { //strange case... skip + inbuffer+=oldlen; + continue; + } + + oldsize = getBufferStringLength(inbuffer, inend); + + if (oldsize < 0) { + *rw = (long)(inend-inbuffer); //rewind, entire string not in buffer + break; + } + } + + if (inbuffer > (inend-oldsize)) { + *rw = (long)(inend-inbuffer); //rewind, entire string not in buffer + break; + } + } else { //VC7x + oldsize = getBufferStringLength(inbuffer, inend); + if (oldsize < 0) { + *rw = (long)(inend-inbuffer); //rewind, entire string not in buffer + break; + } + } + + char oldPath[1024]; + if (oldsize > (long)sizeof(oldPath)) { + //at least don't crash + inbuffer+=oldsize; + continue; + } + memset(oldPath, '\0', sizeof(oldPath)); + strncpy(oldPath, newstr, newlen); + + if (insertReplace) + strncat(oldPath, inbuffer+oldlen, oldsize-oldlen); + + // just replace if it ends with a token in endTokens + if (endsWithTokens(oldPath)) { + if (oldsize < (long)strlen(oldPath)) + oldsize = (long)strlen(oldPath); + + memcpy(inbuffer, oldPath, oldsize); + } + + inbuffer+=oldsize; + continue; + } + } + ++inbuffer; + } + + return write; +} + +bool BinPatch::patch(const char *oldstr, const char *newstr) +{ + size_t oldlen = strlen(oldstr); + size_t newlen = strlen(newstr); + + if ((!fileName || strlen(fileName) < 1) + || (!oldstr || oldlen < 1) + || (!newstr || newlen < 1)) + return false; + + FILE *input; + + if (!(input = fopen(fileName, "r+b"))) + { + fprintf(stderr, "Cannot open file %s!\n", fileName); + return false; + } + + char data[60000]; + long rw = 0; + long offset = 0; + + size_t len; + len = fread(data, sizeof(char), sizeof(data), input); + + do { + if (patchHelper(data, oldstr, newstr, len, &rw)) { + fseek(input, offset, SEEK_SET); //overwrite + fwrite(data, sizeof(char), len, input); + } + + offset += (long)((-rw) + len); + if (fseek(input, offset, SEEK_SET) != 0) + break; + len = fread(data, sizeof(char), sizeof(data), input); + } while(!(feof(input) && (len <= oldlen || len <= newlen))); + + fclose(input); + + return true; +} diff --git a/src/tools/qtlibspatcher/binpatch.h b/src/tools/qtlibspatcher/binpatch.h new file mode 100644 index 0000000000000000000000000000000000000000..a6867d39fbd9e88a73945181b9213f0a5c6e39cd --- /dev/null +++ b/src/tools/qtlibspatcher/binpatch.h @@ -0,0 +1,74 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#ifndef BINPATCH_H +#define BINPATCH_H + +#include <string.h> + +typedef unsigned long ulong; +typedef unsigned int uint; + +class BinPatch +{ +public: + BinPatch(const char *file) + : useLength(false), insertReplace(false) + { + strcpy(endTokens, ""); + strcpy(fileName, file); + } + + void enableUseLength(bool enabled) + { useLength = enabled; } + void enableInsertReplace(bool enabled) + { insertReplace = enabled; } + void setEndTokens(const char *tokens) + { strcpy(endTokens, tokens); } + + bool patch(const char *oldstr, const char *newstr); + +private: + long getBufferStringLength(char *data, char *end); + bool endsWithTokens(const char *data); + + bool patchHelper(char *inbuffer, const char *oldstr, + const char *newstr, size_t len, long *rw); + + bool useLength; + bool insertReplace; + char endTokens[1024]; + char fileName[1024]; +}; + +#endif diff --git a/src/tools/qtlibspatcher/qtlibspatcher.pro b/src/tools/qtlibspatcher/qtlibspatcher.pro new file mode 100644 index 0000000000000000000000000000000000000000..fb0b51c9c9ee893e9e760f0f2cf1569122850524 --- /dev/null +++ b/src/tools/qtlibspatcher/qtlibspatcher.pro @@ -0,0 +1,15 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Di 8. Jul 15:08:13 2008 +###################################################################### + +CONFIG += console +QT -= gui +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . +DESTDIR = ./ + +# Input +HEADERS += binpatch.h +SOURCES += binpatch.cpp qtlibspatchermain.cpp diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp new file mode 100644 index 0000000000000000000000000000000000000000..975e58c971ababc8568ae18acd1311495b9e3fdc --- /dev/null +++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp @@ -0,0 +1,781 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#include "binpatch.h" +#include <cstdio> +#include <iostream> + +#include <QFile> +#include <QRegExp> +#include <QTextStream> +#include <QString> +#include <QtCore/QDebug> + +#ifdef Q_OS_WIN + const char * const oldInstallBase = "C:/qt-greenhouse/Trolltech/Code_less_create_more/" + "Trolltech/Code_less_create_more/Troll/4.4.3"; +#else + const char * const oldSourceBase = "/home/berlin/dev/qt-4.4.3-temp/qt-x11-opensource-src-4.4.3"; + const char * const oldInstallBase = "/home/berlin/dev/qt-4.4.3-shipping"; +#endif + + +char * allocFileNameCopyAppend(const char * textToCopy, + const char * textToAppend, const char * textToAppend2 = NULL); + +void logFileName(const char *fileName) { + std::cout << "Patching file " << fileName << std::endl; +} + +void logDiff(const char *oldText, const char *newText) { + std::cout << " --- " << oldText << std::endl; + std::cout << " +++ " << newText << std::endl; +} + +bool patchBinaryWithQtPathes(const char *fileName, const char *baseQtPath) +{ + bool result = true; + + static const struct + { + const char *variable; + const char *subDirectory; + } variables[] = { + {"qt_prfxpath=", ""}, + {"qt_docspath=", "/doc"}, + {"qt_hdrspath=", "/include"}, + {"qt_libspath=", "/lib"}, + {"qt_binspath=", "/bin"}, + {"qt_plugpath=", "/plugins"}, + {"qt_datapath=", ""}, + {"qt_trnspath=", "/translations"}, + {"qt_xmplpath=", "/examples"}, + {"qt_demopath=", "/demos"} + }; + + logFileName(fileName); + for (int i = 0; i < (int)(sizeof(variables) / sizeof(variables[0])); i++) { + const char * const newStr = allocFileNameCopyAppend(variables[i].variable, baseQtPath, variables[i].subDirectory); + BinPatch binFile(fileName); + const bool success = binFile.patch(variables[i].variable, newStr); + delete[] newStr; + if (!success) { + result = false; + break; + } + } + + return result; +} + +bool patchBinariesWithQtPathes(const char *baseQtPath) +{ + bool result = true; + + static const char *filesToPatch[] = { + #ifdef Q_OS_WIN + "/bin/qmake.exe", + "/bin/QtCore4.dll", + "/bin/QtCored4.dll" + #else + "/bin/qmake", + "/lib/libQtCore.so", + #endif + }; + + for (int i = 0; i < (int)(sizeof(filesToPatch) / sizeof(filesToPatch[0])); i++) { + const char * const fileName = allocFileNameCopyAppend(baseQtPath, filesToPatch[i]); + const bool success = patchBinaryWithQtPathes(fileName, baseQtPath); + delete[] fileName; + if (!success) { + result = false; + break; + } + } + + return result; +} + +char * allocFileNameCopyAppend(const char * textToCopy, + const char * textToAppend, const char * textToAppend2) +{ + const unsigned int bytesToAllocate = FILENAME_MAX; + Q_ASSERT(bytesToAllocate > 0); + Q_ASSERT(textToCopy != NULL); + Q_ASSERT(textToAppend != NULL); + if (textToAppend2 == NULL) + textToAppend2 = ""; + Q_ASSERT(textToAppend2 != NULL); + + char * const res = new char[bytesToAllocate]; + const size_t textToCopyLen = strlen(textToCopy); + const size_t textToAppendLen = strlen(textToAppend); + const size_t textToAppend2Len = strlen(textToAppend2); + + // Array too small? + if (textToCopyLen + textToAppendLen + textToAppend2Len >= bytesToAllocate) { + res[0] = '\0'; + return res; + } + + strncpy(res, textToCopy, bytesToAllocate - 1); + if (textToAppendLen > 0) + strncpy(res + textToCopyLen, textToAppend, bytesToAllocate - textToCopyLen - 1); + if (textToAppend2Len > 0) + strncpy(res + textToCopyLen + textToAppend2Len, textToAppend2, bytesToAllocate - textToCopyLen - textToAppend2Len - 1); + res[textToCopyLen + textToAppendLen + textToAppend2Len] = '\0'; + res[bytesToAllocate - 1] = '\0'; // Safe is safe + return res; +} + + +bool patchDebugLibrariesWithQtPath(const char *baseQtPath) +{ + bool result = true; + + static const struct + { + const char *fileName; + const char *sourceLocation; + } libraries[] = { +#ifdef Q_OS_WIN + {"/bin/Qt3Supportd4.dll", "/src/qt3support/"}, + {"/bin/QtCored4.dll", "/src/corelib/"}, + {"/bin/QtGuid4.dll", "/src/gui/"}, + {"/bin/QtHelpd4.dll", "/tools/assistant/lib/"}, + {"/bin/QtNetworkd4.dll", "/src/network/"}, + {"/bin/QtOpenGLd4.dll", "/src/opengl/"}, + {"/bin/QtScriptd4.dll", "/src/script/"}, + {"/bin/QtSqld4.dll", "/src/sql/"}, + {"/bin/QtSvgd4.dll", "/src/svg/"}, + {"/bin/QtTestd4.dll", "/src/testlib/"}, + {"/bin/QtWebKitd4.dll", "/src/3rdparty/webkit/WebCore/"}, + {"/bin/QtXmld4.dll", "/src/xml/"}, + {"/bin/QtXmlPatternsd4.dll", "/src/xmlpatterns/"}, + {"/plugins/accessible/qtaccessiblecompatwidgetsd4.dll", "/src/plugins/accessible/compat/"}, + {"/plugins/accessible/qtaccessiblewidgetsd4.dll", "/src/plugins/accessible/widgets/"}, + {"/plugins/codecs/qcncodecsd4.dll", "/src/plugins/codecs/cn/"}, + {"/plugins/codecs/qjpcodecsd4.dll", "/src/plugins/codecs/jp/"}, + {"/plugins/codecs/qkrcodecsd4.dll", "/src/plugins/codecs/kr/"}, + {"/plugins/codecs/qtwcodecsd4.dll", "/src/plugins/codecs/tw/"}, + {"/plugins/iconengines/qsvgicond4.dll", "/src/plugins/iconengines/svgiconengine/"}, + {"/plugins/imageformats/qgifd4.dll", "/src/plugins/imageformats/gif/"}, + {"/plugins/imageformats/qjpegd4.dll", "/src/plugins/imageformats/jpeg/"}, + {"/plugins/imageformats/qmngd4.dll", "/src/plugins/imageformats/mng/"}, + {"/plugins/imageformats/qsvgd4.dll", "/src/plugins/imageformats/svg/"}, + {"/plugins/imageformats/qtiffd4.dll", "/src/plugins/imageformats/tiff/"}, + {"/plugins/sqldrivers/qsqlited4.dll", "/src/plugins/sqldrivers/sqlite/"}, +// {"/plugins/sqldrivers/qsqlodbcd4.dll", "/src/plugins/sqldrivers/odbc/"} +#else + {"/examples/tools/plugandpaint/plugins/libpnp_basictools.a", "/examples/tools/plugandpaintplugins/basictools"}, + {"/lib/libQtUiTools.a", "/tools/designer/src/uitools"}, + {"/demos/shared/libdemo_shared.a", "/demos/shared"}, + + {"/plugins/codecs/libqkrcodecs.so.debug", "/plugins/codecs"}, + {"/plugins/codecs/libqtwcodecs.so.debug", "/plugins/codecs"}, + {"/plugins/codecs/libqcncodecs.so.debug", "/plugins/codecs"}, + {"/plugins/codecs/libqjpcodecs.so.debug", "/plugins/codecs"}, + {"/plugins/iconengines/libqsvgicon.so.debug", "/plugins/iconengines"}, + {"/plugins/sqldrivers/libqsqlmysql.so.debug", "/plugins/sqldrivers"}, + {"/plugins/sqldrivers/libqsqlite.so.debug", "/plugins/sqldrivers"}, + {"/plugins/sqldrivers/libqsqlite2.so.debug", "/plugins/sqldrivers"}, + {"/plugins/sqldrivers/libqsqlpsql.so.debug", "/plugins/sqldrivers"}, + {"/plugins/imageformats/libqgif.so.debug", "/plugins/imageformats"}, + {"/plugins/imageformats/libqtiff.so.debug", "/plugins/imageformats"}, + {"/plugins/imageformats/libqsvg.so.debug", "/plugins/imageformats"}, + {"/plugins/imageformats/libqjpeg.so.debug", "/plugins/imageformats"}, + {"/plugins/imageformats/libqico.so.debug", "/plugins/imageformats"}, + {"/plugins/imageformats/libqmng.so.debug", "/plugins/imageformats"}, + {"/plugins/accessible/libqtaccessiblewidgets.so.debug", "/plugins/accessible"}, + {"/plugins/accessible/libqtaccessiblecompatwidgets.so.debug", "/plugins/accessible"}, + {"/plugins/designer/libcontainerextension.so.debug", "/plugins/designer"}, + {"/plugins/designer/libtaskmenuextension.so.debug", "/plugins/designer"}, + {"/plugins/designer/libqwebview.so.debug", "/plugins/designer"}, + {"/plugins/designer/libcustomwidgetplugin.so.debug", "/plugins/designer"}, + {"/plugins/designer/libarthurplugin.so.debug", "/plugins/designer"}, + {"/plugins/designer/libqt3supportwidgets.so.debug", "/plugins/designer"}, + {"/plugins/designer/libworldtimeclockplugin.so.debug", "/plugins/designer"}, + {"/plugins/inputmethods/libqimsw-multi.so.debug", "/plugins/inputmethods"}, + {"/plugins/script/libqtscriptdbus.so.debug", "/plugins/script"}, + {"/examples/draganddrop/puzzle/puzzle.debug", "/examples/draganddrop/puzzle"}, + {"/examples/draganddrop/dropsite/dropsite.debug", "/examples/draganddrop/dropsite"}, + {"/examples/draganddrop/draggabletext/draggabletext.debug", "/examples/draganddrop/draggabletext"}, + {"/examples/draganddrop/draggableicons/draggableicons.debug", "/examples/draganddrop/draggableicons"}, + {"/examples/draganddrop/fridgemagnets/fridgemagnets.debug", "/examples/draganddrop/fridgemagnets"}, + {"/examples/webkit/formextractor/formExtractor.debug", "/examples/webkit/formextractor"}, + {"/examples/webkit/previewer/previewer.debug", "/examples/webkit/previewer"}, + {"/examples/richtext/orderform/orderform.debug", "/examples/richtext/orderform"}, + {"/examples/richtext/calendar/calendar.debug", "/examples/richtext/calendar"}, + {"/examples/richtext/syntaxhighlighter/syntaxhighlighter.debug", "/examples/richtext/syntaxhighlighter"}, + {"/examples/desktop/systray/systray.debug", "/examples/desktop/systray"}, + {"/examples/desktop/screenshot/screenshot.debug", "/examples/desktop/screenshot"}, + {"/examples/linguist/arrowpad/arrowpad.debug", "/examples/linguist/arrowpad"}, + {"/examples/linguist/trollprint/trollprint.debug", "/examples/linguist/trollprint"}, + {"/examples/linguist/hellotr/hellotr.debug", "/examples/linguist/hellotr"}, + {"/examples/ipc/sharedmemory/sharedmemory.debug", "/examples/ipc/sharedmemory"}, + {"/examples/ipc/localfortuneclient/localfortuneclient.debug", "/examples/ipc/localfortuneclient"}, + {"/examples/ipc/localfortuneserver/localfortuneserver.debug", "/examples/ipc/localfortuneserver"}, + {"/examples/threads/waitconditions/waitconditions.debug", "/examples/threads/waitconditions"}, + {"/examples/threads/semaphores/semaphores.debug", "/examples/threads/semaphores"}, + {"/examples/threads/mandelbrot/mandelbrot.debug", "/examples/threads/mandelbrot"}, + {"/examples/dbus/listnames/listnames.debug", "/examples/dbus/listnames"}, + {"/examples/dbus/pingpong/ping.debug", "/examples/dbus/pingpong"}, + {"/examples/dbus/pingpong/pong.debug", "/examples/dbus/pingpong"}, + {"/examples/dbus/complexpingpong/complexping.debug", "/examples/dbus/complexpingpong"}, + {"/examples/dbus/complexpingpong/complexpong.debug", "/examples/dbus/complexpingpong"}, + {"/examples/dbus/chat/dbus-chat.debug", "/examples/dbus/chat"}, + {"/examples/dbus/remotecontrolledcar/car/car.debug", "/examples/dbus/remotecontrolledcar/car"}, + {"/examples/dbus/remotecontrolledcar/controller/controller.debug", "/examples/dbus/remotecontrolledcar/controller"}, + {"/examples/qtconcurrent/wordcount/wordcount.debug", "/examples/qtconcurrent/wordcount"}, + {"/examples/qtconcurrent/runfunction/runfunction.debug", "/examples/qtconcurrent/runfunction"}, + {"/examples/qtconcurrent/progressdialog/progressdialog.debug", "/examples/qtconcurrent/progressdialog"}, + {"/examples/qtconcurrent/map/mapdemo.debug", "/examples/qtconcurrent/map"}, + {"/examples/qtconcurrent/imagescaling/imagescaling.debug", "/examples/qtconcurrent/imagescaling"}, + {"/examples/designer/calculatorform/calculatorform.debug", "/examples/designer/calculatorform"}, + {"/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.debug", "/examples/designer/worldtimeclockbuilder"}, + {"/examples/designer/calculatorbuilder/calculatorbuilder.debug", "/examples/designer/calculatorbuilder"}, + {"/examples/sql/drilldown/drilldown.debug", "/examples/sql/drilldown"}, + {"/examples/sql/masterdetail/masterdetail.debug", "/examples/sql/masterdetail"}, + {"/examples/sql/tablemodel/tablemodel.debug", "/examples/sql/tablemodel"}, + {"/examples/sql/relationaltablemodel/relationaltablemodel.debug", "/examples/sql/relationaltablemodel"}, + {"/examples/sql/querymodel/querymodel.debug", "/examples/sql/querymodel"}, + {"/examples/sql/cachedtable/cachedtable.debug", "/examples/sql/cachedtable"}, + {"/examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.debug", "/examples/xmlpatterns/qobjectxmlmodel"}, + {"/examples/xmlpatterns/recipes/recipes.debug", "/examples/xmlpatterns/recipes"}, + {"/examples/xmlpatterns/filetree/filetree.debug", "/examples/xmlpatterns/filetree"}, + {"/examples/assistant/simpletextviewer/simpletextviewer.debug", "/examples/assistant/simpletextviewer"}, + {"/examples/help/simpletextviewer/simpletextviewer.debug", "/examples/help/simpletextviewer"}, + {"/examples/help/contextsensitivehelp/contextsensitivehelp.debug", "/examples/help/contextsensitivehelp"}, + {"/examples/help/remotecontrol/remotecontrol.debug", "/examples/help/remotecontrol"}, + {"/examples/opengl/grabber/grabber.debug", "/examples/opengl/grabber"}, + {"/examples/opengl/framebufferobject2/framebufferobject2.debug", "/examples/opengl/framebufferobject2"}, + {"/examples/opengl/hellogl/hellogl.debug", "/examples/opengl/hellogl"}, + {"/examples/opengl/framebufferobject/framebufferobject.debug", "/examples/opengl/framebufferobject"}, + {"/examples/opengl/overpainting/overpainting.debug", "/examples/opengl/overpainting"}, + {"/examples/opengl/pbuffers2/pbuffers2.debug", "/examples/opengl/pbuffers2"}, + {"/examples/opengl/2dpainting/2dpainting.debug", "/examples/opengl/2dpainting"}, + {"/examples/opengl/pbuffers/pbuffers.debug", "/examples/opengl/pbuffers"}, + {"/examples/opengl/samplebuffers/samplebuffers.debug", "/examples/opengl/samplebuffers"}, + {"/examples/opengl/textures/textures.debug", "/examples/opengl/textures"}, + {"/examples/graphicsview/elasticnodes/elasticnodes.debug", "/examples/graphicsview/elasticnodes"}, + {"/examples/graphicsview/collidingmice/collidingmice.debug", "/examples/graphicsview/collidingmice"}, + {"/examples/graphicsview/portedasteroids/portedasteroids.debug", "/examples/graphicsview/portedasteroids"}, + {"/examples/graphicsview/padnavigator/padnavigator.debug", "/examples/graphicsview/padnavigator"}, + {"/examples/graphicsview/portedcanvas/portedcanvas.debug", "/examples/graphicsview/portedcanvas"}, + {"/examples/graphicsview/diagramscene/diagramscene.debug", "/examples/graphicsview/diagramscene"}, + {"/examples/graphicsview/dragdroprobot/dragdroprobot.debug", "/examples/graphicsview/dragdroprobot"}, + {"/examples/mainwindows/menus/menus.debug", "/examples/mainwindows/menus"}, + {"/examples/mainwindows/mdi/mdi.debug", "/examples/mainwindows/mdi"}, + {"/examples/mainwindows/sdi/sdi.debug", "/examples/mainwindows/sdi"}, + {"/examples/mainwindows/recentfiles/recentfiles.debug", "/examples/mainwindows/recentfiles"}, + {"/examples/mainwindows/application/application.debug", "/examples/mainwindows/application"}, + {"/examples/mainwindows/dockwidgets/dockwidgets.debug", "/examples/mainwindows/dockwidgets"}, + {"/examples/widgets/tablet/tablet.debug", "/examples/widgets/tablet"}, + {"/examples/widgets/shapedclock/shapedclock.debug", "/examples/widgets/shapedclock"}, + {"/examples/widgets/styles/styles.debug", "/examples/widgets/styles"}, + {"/examples/widgets/icons/icons.debug", "/examples/widgets/icons"}, + {"/examples/widgets/charactermap/charactermap.debug", "/examples/widgets/charactermap"}, + {"/examples/widgets/sliders/sliders.debug", "/examples/widgets/sliders"}, + {"/examples/widgets/tooltips/tooltips.debug", "/examples/widgets/tooltips"}, + {"/examples/widgets/windowflags/windowflags.debug", "/examples/widgets/windowflags"}, + {"/examples/widgets/stylesheet/stylesheet.debug", "/examples/widgets/stylesheet"}, + {"/examples/widgets/spinboxes/spinboxes.debug", "/examples/widgets/spinboxes"}, + {"/examples/widgets/validators/validators.debug", "/examples/widgets/validators"}, + {"/examples/widgets/calculator/calculator.debug", "/examples/widgets/calculator"}, + {"/examples/widgets/groupbox/groupbox.debug", "/examples/widgets/groupbox"}, + {"/examples/widgets/scribble/scribble.debug", "/examples/widgets/scribble"}, + {"/examples/widgets/imageviewer/imageviewer.debug", "/examples/widgets/imageviewer"}, + {"/examples/widgets/digitalclock/digitalclock.debug", "/examples/widgets/digitalclock"}, + {"/examples/widgets/lineedits/lineedits.debug", "/examples/widgets/lineedits"}, + {"/examples/widgets/movie/movie.debug", "/examples/widgets/movie"}, + {"/examples/widgets/calendarwidget/calendarwidget.debug", "/examples/widgets/calendarwidget"}, + {"/examples/widgets/wiggly/wiggly.debug", "/examples/widgets/wiggly"}, + {"/examples/widgets/analogclock/analogclock.debug", "/examples/widgets/analogclock"}, + {"/examples/widgets/tetrix/tetrix.debug", "/examples/widgets/tetrix"}, + {"/examples/painting/basicdrawing/basicdrawing.debug", "/examples/painting/basicdrawing"}, + {"/examples/painting/svgviewer/svgviewer.debug", "/examples/painting/svgviewer"}, + {"/examples/painting/fontsampler/fontsampler.debug", "/examples/painting/fontsampler"}, + {"/examples/painting/concentriccircles/concentriccircles.debug", "/examples/painting/concentriccircles"}, + {"/examples/painting/painterpaths/painterpaths.debug", "/examples/painting/painterpaths"}, + {"/examples/painting/imagecomposition/imagecomposition.debug", "/examples/painting/imagecomposition"}, + {"/examples/painting/transformations/transformations.debug", "/examples/painting/transformations"}, + {"/examples/tools/customcompleter/customcompleter.debug", "/examples/tools/customcompleter"}, + {"/examples/tools/codecs/codecs.debug", "/examples/tools/codecs"}, + {"/examples/tools/plugandpaint/plugins/libpnp_extrafilters.so.debug", "/examples/tools/plugandpaint/plugins"}, + {"/examples/tools/plugandpaint/plugandpaint.debug", "/examples/tools/plugandpaint"}, + {"/examples/tools/regexp/regexp.debug", "/examples/tools/regexp"}, + {"/examples/tools/undoframework/undoframework.debug", "/examples/tools/undoframework"}, + {"/examples/tools/i18n/i18n.debug", "/examples/tools/i18n"}, + {"/examples/tools/completer/completer.debug", "/examples/tools/completer"}, + {"/examples/tools/echoplugin/plugin/libechoplugin.so.debug", "/examples/tools/echoplugin/plugin"}, + {"/examples/tools/echoplugin/echoplugin.debug", "/examples/tools/echoplugin"}, + {"/examples/tools/styleplugin/styles/libsimplestyleplugin.so.debug", "/examples/tools/styleplugin/styles"}, + {"/examples/tools/styleplugin/styleplugin.debug", "/examples/tools/styleplugin"}, + {"/examples/tools/treemodelcompleter/treemodelcompleter.debug", "/examples/tools/treemodelcompleter"}, + {"/examples/tools/settingseditor/settingseditor.debug", "/examples/tools/settingseditor"}, + {"/examples/network/securesocketclient/securesocketclient.debug", "/examples/network/securesocketclient"}, + {"/examples/network/broadcastreceiver/broadcastreceiver.debug", "/examples/network/broadcastreceiver"}, + {"/examples/network/downloadmanager/downloadmanager.debug", "/examples/network/downloadmanager"}, + {"/examples/network/fortuneserver/fortuneserver.debug", "/examples/network/fortuneserver"}, + {"/examples/network/loopback/loopback.debug", "/examples/network/loopback"}, + {"/examples/network/http/http.debug", "/examples/network/http"}, + {"/examples/network/ftp/ftp.debug", "/examples/network/ftp"}, + {"/examples/network/download/download.debug", "/examples/network/download"}, + {"/examples/network/fortuneclient/fortuneclient.debug", "/examples/network/fortuneclient"}, + {"/examples/network/blockingfortuneclient/blockingfortuneclient.debug", "/examples/network/blockingfortuneclient"}, + {"/examples/network/broadcastsender/broadcastsender.debug", "/examples/network/broadcastsender"}, + {"/examples/network/threadedfortuneserver/threadedfortuneserver.debug", "/examples/network/threadedfortuneserver"}, + {"/examples/network/chat/network-chat.debug", "/examples/network/chat"}, + {"/examples/network/torrent/torrent.debug", "/examples/network/torrent"}, + {"/examples/qtestlib/tutorial4/tutorial4.debug", "/examples/qtestlib/tutorial4"}, + {"/examples/qtestlib/tutorial1/tutorial1.debug", "/examples/qtestlib/tutorial1"}, + {"/examples/qtestlib/tutorial2/tutorial2.debug", "/examples/qtestlib/tutorial2"}, + {"/examples/qtestlib/tutorial3/tutorial3.debug", "/examples/qtestlib/tutorial3"}, + {"/examples/tutorials/tutorial/t3/t3.debug", "/examples/tutorials/tutorial/t3"}, + {"/examples/tutorials/tutorial/t5/t5.debug", "/examples/tutorials/tutorial/t5"}, + {"/examples/tutorials/tutorial/t2/t2.debug", "/examples/tutorials/tutorial/t2"}, + {"/examples/tutorials/tutorial/t11/t11.debug", "/examples/tutorials/tutorial/t11"}, + {"/examples/tutorials/tutorial/t6/t6.debug", "/examples/tutorials/tutorial/t6"}, + {"/examples/tutorials/tutorial/t13/t13.debug", "/examples/tutorials/tutorial/t13"}, + {"/examples/tutorials/tutorial/t12/t12.debug", "/examples/tutorials/tutorial/t12"}, + {"/examples/tutorials/tutorial/t9/t9.debug", "/examples/tutorials/tutorial/t9"}, + {"/examples/tutorials/tutorial/t1/t1.debug", "/examples/tutorials/tutorial/t1"}, + {"/examples/tutorials/tutorial/t4/t4.debug", "/examples/tutorials/tutorial/t4"}, + {"/examples/tutorials/tutorial/t14/t14.debug", "/examples/tutorials/tutorial/t14"}, + {"/examples/tutorials/tutorial/t8/t8.debug", "/examples/tutorials/tutorial/t8"}, + {"/examples/tutorials/tutorial/t7/t7.debug", "/examples/tutorials/tutorial/t7"}, + {"/examples/tutorials/tutorial/t10/t10.debug", "/examples/tutorials/tutorial/t10"}, + {"/examples/tutorials/addressbook/part2/part2.debug", "/examples/tutorials/addressbook/part2"}, + {"/examples/tutorials/addressbook/part5/part5.debug", "/examples/tutorials/addressbook/part5"}, + {"/examples/tutorials/addressbook/part3/part3.debug", "/examples/tutorials/addressbook/part3"}, + {"/examples/tutorials/addressbook/part4/part4.debug", "/examples/tutorials/addressbook/part4"}, + {"/examples/tutorials/addressbook/part7/part7.debug", "/examples/tutorials/addressbook/part7"}, + {"/examples/tutorials/addressbook/part1/part1.debug", "/examples/tutorials/addressbook/part1"}, + {"/examples/tutorials/addressbook/part6/part6.debug", "/examples/tutorials/addressbook/part6"}, + {"/examples/xml/streambookmarks/streambookmarks.debug", "/examples/xml/streambookmarks"}, + {"/examples/xml/saxbookmarks/saxbookmarks.debug", "/examples/xml/saxbookmarks"}, + {"/examples/xml/xmlstreamlint/xmlstreamlint.debug", "/examples/xml/xmlstreamlint"}, + {"/examples/xml/dombookmarks/dombookmarks.debug", "/examples/xml/dombookmarks"}, + {"/examples/xml/rsslisting/rsslisting.debug", "/examples/xml/rsslisting"}, + {"/examples/layouts/dynamiclayouts/dynamiclayouts.debug", "/examples/layouts/dynamiclayouts"}, + {"/examples/layouts/flowlayout/flowlayout.debug", "/examples/layouts/flowlayout"}, + {"/examples/layouts/borderlayout/borderlayout.debug", "/examples/layouts/borderlayout"}, + {"/examples/layouts/basiclayouts/basiclayouts.debug", "/examples/layouts/basiclayouts"}, + {"/examples/dialogs/trivialwizard/trivialwizard.debug", "/examples/dialogs/trivialwizard"}, + {"/examples/dialogs/extension/extension.debug", "/examples/dialogs/extension"}, + {"/examples/dialogs/standarddialogs/standarddialogs.debug", "/examples/dialogs/standarddialogs"}, + {"/examples/dialogs/tabdialog/tabdialog.debug", "/examples/dialogs/tabdialog"}, + {"/examples/dialogs/classwizard/classwizard.debug", "/examples/dialogs/classwizard"}, + {"/examples/dialogs/findfiles/findfiles.debug", "/examples/dialogs/findfiles"}, + {"/examples/dialogs/licensewizard/licensewizard.debug", "/examples/dialogs/licensewizard"}, + {"/examples/dialogs/configdialog/configdialog.debug", "/examples/dialogs/configdialog"}, + {"/examples/itemviews/coloreditorfactory/coloreditorfactory.debug", "/examples/itemviews/coloreditorfactory"}, + {"/examples/itemviews/pixelator/pixelator.debug", "/examples/itemviews/pixelator"}, + {"/examples/itemviews/simplewidgetmapper/simplewidgetmapper.debug", "/examples/itemviews/simplewidgetmapper"}, + {"/examples/itemviews/puzzle/puzzle.debug", "/examples/itemviews/puzzle"}, + {"/examples/itemviews/dirview/dirview.debug", "/examples/itemviews/dirview"}, + {"/examples/itemviews/addressbook/addressbook.debug", "/examples/itemviews/addressbook"}, + {"/examples/itemviews/spinboxdelegate/spinboxdelegate.debug", "/examples/itemviews/spinboxdelegate"}, + {"/examples/itemviews/simpletreemodel/simpletreemodel.debug", "/examples/itemviews/simpletreemodel"}, + {"/examples/itemviews/chart/chart.debug", "/examples/itemviews/chart"}, + {"/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.debug", "/examples/itemviews/basicsortfiltermodel"}, + {"/examples/itemviews/customsortfiltermodel/customsortfiltermodel.debug", "/examples/itemviews/customsortfiltermodel"}, + {"/examples/itemviews/stardelegate/stardelegate.debug", "/examples/itemviews/stardelegate"}, + {"/examples/itemviews/editabletreemodel/editabletreemodel.debug", "/examples/itemviews/editabletreemodel"}, + {"/examples/itemviews/simpledommodel/simpledommodel.debug", "/examples/itemviews/simpledommodel"}, + {"/examples/uitools/multipleinheritance/multipleinheritance.debug", "/examples/uitools/multipleinheritance"}, + {"/examples/uitools/textfinder/textfinder.debug", "/examples/uitools/textfinder"}, + {"/examples/script/helloscript/helloscript.debug", "/examples/script/helloscript"}, + {"/examples/script/marshal/marshal.debug", "/examples/script/marshal"}, + {"/examples/script/customclass/customclass.debug", "/examples/script/customclass"}, + {"/examples/script/calculator/calculator.debug", "/examples/script/calculator"}, + {"/examples/script/context2d/context2d.debug", "/examples/script/context2d"}, + {"/examples/script/defaultprototypes/defaultprototypes.debug", "/examples/script/defaultprototypes"}, + {"/examples/script/qscript/qscript.debug", "/examples/script/qscript"}, + {"/examples/script/tetrix/tetrix.debug", "/examples/script/tetrix"}, + {"/lib/libQtTest.so.4.4.3.debug", "/lib"}, + {"/lib/libQtDesignerComponents.so.4.4.3.debug", "/lib"}, + {"/lib/libQtScript.so.4.4.3.debug", "/lib"}, + {"/lib/libQtDesigner.so.4.4.3.debug", "/lib"}, + {"/lib/libQtGui.so.4.4.3.debug", "/lib"}, + {"/lib/libQtSvg.so.4.4.3.debug", "/lib"}, + {"/lib/libQtXml.so.4.4.3.debug", "/lib"}, + {"/lib/libQtCLucene.so.4.4.3.debug", "/lib"}, + {"/lib/libQtCore.so.4.4.3.debug", "/lib"}, + {"/lib/libQtDBus.so.4.4.3.debug", "/lib"}, + {"/lib/libQtXmlPatterns.so.4.4.3.debug", "/lib"}, + {"/lib/libQtHelp.so.4.4.3.debug", "/lib"}, + {"/lib/libQtSql.so.4.4.3.debug", "/lib"}, + {"/lib/libQtNetwork.so.4.4.3.debug", "/lib"}, + {"/lib/libQtOpenGL.so.4.4.3.debug", "/lib"}, + {"/lib/libQt3Support.so.4.4.3.debug", "/lib"}, + {"/lib/libQtAssistantClient.so.4.4.3.debug", "/lib"}, + {"/lib/libQtWebKit.so.4.4.3.debug", "/lib"}, + {"/demos/spreadsheet/spreadsheet.debug", "/demos/spreadsheet"}, + {"/demos/composition/composition.debug", "/demos/composition"}, + {"/demos/gradients/gradients.debug", "/demos/gradients"}, + {"/demos/deform/deform.debug", "/demos/deform"}, + {"/demos/embeddeddialogs/embeddeddialogs.debug", "/demos/embeddeddialogs"}, + {"/demos/textedit/textedit.debug", "/demos/textedit"}, + {"/demos/browser/browser.debug", "/demos/browser"}, + {"/demos/interview/interview.debug", "/demos/interview"}, + {"/demos/affine/affine.debug", "/demos/affine"}, + {"/demos/books/books.debug", "/demos/books"}, + {"/demos/chip/chip.debug", "/demos/chip"}, + {"/demos/pathstroke/pathstroke.debug", "/demos/pathstroke"}, + {"/demos/undo/undo.debug", "/demos/undo"}, + {"/demos/sqlbrowser/sqlbrowser.debug", "/demos/sqlbrowser"}, + {"/demos/mainwindow/mainwindow.debug", "/demos/mainwindow"}, + {"/bin/qcollectiongenerator.debug", "/bin"}, + {"/bin/qhelpconverter.debug", "/bin"}, + {"/bin/lupdate.debug", "/bin"}, + {"/bin/moc.debug", "/bin"}, + {"/bin/pixeltool.debug", "/bin"}, + {"/bin/qdbusviewer.debug", "/bin"}, + {"/bin/qtconfig.debug", "/bin"}, + {"/bin/qdbusxml2cpp.debug", "/bin"}, + {"/bin/qdbus.debug", "/bin"}, + {"/bin/uic3.debug", "/bin"}, + {"/bin/qhelpgenerator.debug", "/bin"}, + {"/bin/qt3to4.debug", "/bin"}, + {"/bin/xmlpatterns.debug", "/bin"}, + {"/bin/linguist.debug", "/bin"}, + {"/bin/uic.debug", "/bin"}, + {"/bin/qtdemo.debug", "/bin"}, + {"/bin/lrelease.debug", "/bin"}, + {"/bin/qmake", "/bin"}, + {"/bin/assistant.debug", "/bin"}, + {"/bin/rcc.debug", "/bin"}, + {"/bin/designer.debug", "/bin"}, + {"/bin/assistant_adp.debug", "/bin"}, + {"/bin/qdbuscpp2xml.debug", "/bin"}, + + + {"/plugins/codecs/libqkrcodecs.so.debug", "/src/plugins/codecs/kr"}, + {"/plugins/codecs/libqtwcodecs.so.debug", "/src/plugins/codecs/tw"}, + {"/plugins/codecs/libqcncodecs.so.debug", "/src/plugins/codecs/cn"}, + {"/plugins/codecs/libqjpcodecs.so.debug", "/src/plugins/codecs/jp"}, + {"/plugins/iconengines/libqsvgicon.so.debug", "/src/plugins/iconengines/svgiconengine"}, + {"/plugins/sqldrivers/libqsqlmysql.so.debug", "/src/plugins/sqldrivers/mysql"}, + {"/plugins/sqldrivers/libqsqlite.so.debug", "/src/plugins/sqldrivers/sqlite"}, + {"/plugins/sqldrivers/libqsqlite2.so.debug", "/src/plugins/sqldrivers/sqlite2"}, + {"/plugins/sqldrivers/libqsqlpsql.so.debug", "/src/plugins/sqldrivers/psql"}, + {"/plugins/imageformats/libqgif.so.debug", "/src/plugins/imageformats/gif"}, + {"/plugins/imageformats/libqtiff.so.debug", "/src/plugins/imageformats/tiff"}, + {"/plugins/imageformats/libqsvg.so.debug", "/src/plugins/imageformats/svg"}, + {"/plugins/imageformats/libqjpeg.so.debug", "/src/plugins/imageformats/jpeg"}, + {"/plugins/imageformats/libqico.so.debug", "/src/plugins/imageformats/ico"}, + {"/plugins/imageformats/libqmng.so.debug", "/src/plugins/imageformats/mng"}, + {"/plugins/accessible/libqtaccessiblewidgets.so.debug", "/src/plugins/accessible/widgets"}, + {"/plugins/accessible/libqtaccessiblecompatwidgets.so.debug", "/src/plugins/accessible/compat"}, + {"/plugins/designer/libcontainerextension.so.debug", "/examples/designer/containerextension"}, + {"/plugins/designer/libtaskmenuextension.so.debug", "/examples/designer/taskmenuextension"}, + {"/plugins/designer/libqwebview.so.debug", "/tools/designer/src/plugins/qwebview"}, + {"/plugins/designer/libcustomwidgetplugin.so.debug", "/examples/designer/customwidgetplugin"}, + {"/plugins/designer/libarthurplugin.so.debug", "/demos/arthurplugin"}, + {"/plugins/designer/libarthurplugin.so.debug", "/demos/shared"}, + {"/plugins/designer/libqt3supportwidgets.so.debug", "/tools/designer/src/plugins/widgets"}, + {"/plugins/designer/libworldtimeclockplugin.so.debug", "/examples/designer/worldtimeclockplugin"}, + {"/plugins/inputmethods/libqimsw-multi.so.debug", "/src/plugins/inputmethods/imsw-multi"}, + {"/plugins/script/libqtscriptdbus.so.debug", "/src/plugins/script/qtdbus"}, + + {"/examples/dbus/chat/dbus-chat.debug", "/examples/dbus/dbus-chat"}, + {"/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.debug", "/tools/designer/src/uitools"}, + {"/examples/designer/calculatorbuilder/calculatorbuilder.debug", "/tools/designer/src/uitools"}, + {"/examples/tools/plugandpaint/plugins/libpnp_extrafilters.so.debug", "/examples/tools/plugandpaintplugins/extrafilters"}, + {"/examples/tools/styleplugin/styles/libsimplestyleplugin.so.debug", "/examples/tools/styleplugin/plugin"}, + {"/examples/network/chat/network-chat.debug", "/examples/network/network-chat"}, + {"/examples/uitools/textfinder/textfinder.debug", "/tools/designer/src/uitools"}, + {"/examples/script/calculator/calculator.debug", "/tools/designer/src/uitools"}, + {"/examples/script/tetrix/tetrix.debug", "/tools/designer/src/uitools"}, + + {"/lib/libQtTest.so.4.4.3.debug", "/src/testlib"}, + {"/lib/libQtDesignerComponents.so.4.4.3.debug", "/tools/designer/src/components"}, + {"/lib/libQtScript.so.4.4.3.debug", "/src/script"}, + {"/lib/libQtDesigner.so.4.4.3.debug", "/tools/designer/src/lib"}, + {"/lib/libQtGui.so.4.4.3.debug", "/src/gui"}, + {"/lib/libQtSvg.so.4.4.3.debug", "/src/svg"}, + {"/lib/libQtXml.so.4.4.3.debug", "/src/xml"}, + {"/lib/libQtCLucene.so.4.4.3.debug", "/tools/assistant/lib/fulltextsearch"}, + {"/lib/libQtCore.so.4.4.3.debug", "/src/corelib"}, + {"/lib/libQtDBus.so.4.4.3.debug", "/src/dbus"}, + {"/lib/libQtXmlPatterns.so.4.4.3.debug", "/src/xmlpatterns"}, + {"/lib/libQtHelp.so.4.4.3.debug", "/tools/assistant/lib"}, + {"/lib/libQtSql.so.4.4.3.debug", "/src/sql"}, + {"/lib/libQtNetwork.so.4.4.3.debug", "/src/network"}, + {"/lib/libQtOpenGL.so.4.4.3.debug", "/src/opengl"}, + {"/lib/libQt3Support.so.4.4.3.debug", "/src/qt3support"}, + {"/lib/libQtAssistantClient.so.4.4.3.debug", "/tools/assistant/compat/lib"}, + {"/lib/libQtWebKit.so.4.4.3.debug", "/src/3rdparty/webkit/WebCore"}, + + {"/demos/composition/composition.debug", "/demos/shared"}, + {"/demos/gradients/gradients.debug", "/demos/shared"}, + {"/demos/deform/deform.debug", "/demos/shared"}, + {"/demos/browser/browser.debug", "/tools/designer/src/uitools"}, + {"/demos/affine/affine.debug", "/demos/shared"}, + {"/demos/pathstroke/pathstroke.debug", "/demos/shared"}, + + {"/bin/qcollectiongenerator.debug", "/tools/assistant/tools/qcollectiongenerator"}, + {"/bin/qhelpconverter.debug", "/tools/assistant/tools/qhelpconverter"}, + {"/bin/lupdate.debug", "/tools/linguist/lupdate"}, + {"/bin/moc.debug", "/src/tools/moc"}, + {"/bin/pixeltool.debug", "/tools/pixeltool"}, + {"/bin/qdbusviewer.debug", "/tools/qdbus/qdbusviewer"}, + {"/bin/qtconfig.debug", "/tools/qtconfig"}, + {"/bin/qdbusxml2cpp.debug", "/tools/qdbus/qdbusxml2cpp"}, + {"/bin/qdbus.debug", "/tools/qdbus/qdbus"}, + {"/bin/uic3.debug", "/src/tools/uic3"}, + {"/bin/qhelpgenerator.debug", "/tools/assistant/tools/qhelpgenerator"}, + {"/bin/qt3to4.debug", "/tools/porting/src"}, + {"/bin/xmlpatterns.debug", "/tools/xmlpatterns"}, + {"/bin/linguist.debug", "/tools/designer/src/uitools"}, + {"/bin/linguist.debug", "/tools/linguist/linguist"}, + {"/bin/uic.debug", "/src/tools/uic"}, + {"/bin/qtdemo.debug", "/demos/qtdemo"}, + {"/bin/lrelease.debug", "/tools/linguist/lrelease"}, + {"/bin/qmake", "/qmake"}, + {"/bin/assistant.debug", "/tools/assistant/tools/assistant"}, + {"/bin/rcc.debug", "/src/tools/rcc"}, + {"/bin/designer.debug", "/tools/designer/src/designer"}, + {"/bin/assistant_adp.debug", "/tools/assistant/compat"}, + {"/bin/qdbuscpp2xml.debug", "/tools/qdbus/qdbuscpp2xml"} +#endif + }; + + + for (int i = 0; i < (int)(sizeof(libraries) / sizeof(libraries[0])); i++) { + // USAGE NOTE: Don't use FILENAME_MAX as the size of an array in which to store a file name! + // [In some cases] you [may not be able to statically] make an array that big! + // Use dynamic allocation [..] instead. + // From http://www.gnu.org/software/libc/manual/html_mono/libc.html#Limits-for-Files + + // Make filename + char * const fileName = allocFileNameCopyAppend(baseQtPath, libraries[i].fileName); + logFileName(fileName); + + // Make old source path array + char * const oldSourcePath = allocFileNameCopyAppend(oldSourceBase, + libraries[i].sourceLocation); + + // Make new source path array + char * const newSourcePath = allocFileNameCopyAppend(baseQtPath, + libraries[i].sourceLocation); + + logDiff(oldSourcePath, newSourcePath); + + // Patch + BinPatch binFile(fileName); + if (!binFile.patch(oldSourcePath, newSourcePath)) { + result = false; + } + + delete[] fileName; + delete[] oldSourcePath; + delete[] newSourcePath; + + if (!result) + break; + } + + return result; +} + +void patchQMakeSpec(const char *path) +{ + QString baseQtPath(path); + const QString fileName(baseQtPath + "/mkspecs/default/qmake.conf"); + QFile f(fileName); + logFileName(qPrintable(fileName)); + f.open(QIODevice::ReadOnly); + QTextStream in(&f); + QString all = in.readAll(); + f.close(); + // Old value is QMAKESPEC_ORIGINAL=C:/somepath/mkspecs/amakespce + // New value should be QMAKESPEC_ORIGINAL=baseQtPath/mkspec/amakespec + // We don't care to match the line end we simply match to the end of the file + QRegExp regExp("(QMAKESPEC_ORIGINAL=).*(/mkspecs/.*)"); + all.replace(regExp, "\\1"+baseQtPath+"\\2"); + + f.open(QIODevice::WriteOnly); + QTextStream out(&f); + out << all; +} + +const char * const textFileFileNames[] = +{ +#ifndef Q_OS_WIN + // *.la + "lib/libQtCore.la", + "lib/libQt3Support.la", + "lib/libQtCLucene.la", + "lib/libQtDBus.la", + "lib/libQtGui.la", + "lib/libQtHelp.la", + "lib/libQtNetwork.la", + "lib/libQtOpenGL.la", + "lib/libQtScript.la", + "lib/libQtSql.la", + "lib/libQtSvg.la", + "lib/libQtTest.la", + "lib/libQtWebKit.la", + "lib/libQtXml.la", + "lib/libQtXmlPatterns.la", + + // *.prl + "demos/shared/libdemo_shared.prl", + "lib/libQt3Support.prl", + "lib/libQtAssistantClient.prl", + "lib/libQtCLucene.prl", + "lib/libQtCore.prl", + "lib/libQtDBus.prl", + "lib/libQtDesignerComponents.prl", + "lib/libQtDesigner.prl", + "lib/libQtGui.prl", + "lib/libQtHelp.prl", + "lib/libQtNetwork.prl", + "lib/libQtOpenGL.prl", + "lib/libQtScript.prl", + "lib/libQtSql.prl", + "lib/libQtSvg.prl", + "lib/libQtTest.prl", + "lib/libQtUiTools.prl", + "lib/libQtWebKit.prl", + "lib/libQtXmlPatterns.prl", + "lib/libQtXml.prl", + + // *.pc + "lib/pkgconfig/Qt3Support.pc", + "lib/pkgconfig/QtAssistantClient.pc", + "lib/pkgconfig/QtCLucene.pc", + "lib/pkgconfig/QtCore.pc", + "lib/pkgconfig/QtDBus.pc", + "lib/pkgconfig/QtDesignerComponents.pc", + "lib/pkgconfig/QtDesigner.pc", + "lib/pkgconfig/QtGui.pc", + "lib/pkgconfig/QtHelp.pc", + "lib/pkgconfig/QtNetwork.pc", + "lib/pkgconfig/QtOpenGL.pc", + "lib/pkgconfig/QtScript.pc", + "lib/pkgconfig/QtSql.pc", + "lib/pkgconfig/QtSvg.pc", + "lib/pkgconfig/QtTest.pc", + "lib/pkgconfig/QtUiTools.pc", + "lib/pkgconfig/QtWebKit.pc", + "lib/pkgconfig/QtXmlPatterns.pc", + "lib/pkgconfig/QtXml.pc", + + // misc + "mkspecs/qconfig.pri" +#endif +}; + +void replaceInTextFile(const char * fileName, + const char * oldText, const char * newText, + const char * oldText2 = NULL, const char * newText2 = NULL) +{ + const QString errorMessage = QString("Could not patch file ") + fileName; + + QFile f(fileName); + if (!f.open(QIODevice::ReadOnly)) { + std::cout << qPrintable(errorMessage) << std::endl; + return; + } + QTextStream in(&f); + QString all = in.readAll(); + f.close(); + + all.replace(QString(oldText), QString(newText), Qt::CaseSensitive); + if ((oldText2 != NULL) && (newText2 != NULL)) { + all = all.replace(QString(oldText2), QString(newText2), Qt::CaseSensitive); + } + + if (!f.open(QIODevice::WriteOnly)) { + std::cout << qPrintable(errorMessage) << std::endl; + return; + } + QTextStream out(&f); + out << all; + f.close(); +} + +void patchTextFiles(const char *newInstallBase) +{ + const char * const newSourceBase = newInstallBase; + const int fileCount = sizeof(textFileFileNames) / sizeof(const char *); + for (int i = 0; i < fileCount; i++) { + logFileName(textFileFileNames[i]); + logDiff(oldSourceBase, newSourceBase); +#ifndef Q_OS_WIN + logDiff(oldInstallBase, newInstallBase); +#endif + replaceInTextFile(textFileFileNames[i], +#ifndef Q_OS_WIN + oldSourceBase, newSourceBase, +#endif + oldInstallBase, newInstallBase); + } + + patchQMakeSpec(newInstallBase); +} + +int main(int argc, char *args[]) +{ + if (argc != 2) { + printf("Please provide a QTDIR value as parameter.\n" + "This is also the location where the binaries are expected\n" + "in the \"/bin\" and \"/plugins\" subdirectories.\n"); + return 1; + } + + char * const baseQtPath = allocFileNameCopyAppend(args[1], ""); + +#ifdef Q_OS_WIN + // Convert backslash to slash + for (char *p = baseQtPath; *p != '\0'; p++) + if (*p == '\\') + *p = '/'; +#endif + + // Remove trailing slash(es) + for (char *p = baseQtPath + strlen(baseQtPath) - 1; p != baseQtPath; p--) + if (*p == '/') + *p = '\0'; + else + break; + + patchTextFiles(baseQtPath); + const bool success = patchBinariesWithQtPathes(baseQtPath) + && patchDebugLibrariesWithQtPath(baseQtPath); + delete[] baseQtPath; + return success ? 0 : 1; +} diff --git a/tests/manual/gdbdebugger/spacy-file/app with space.cpp b/tests/manual/gdbdebugger/spacy-file/app with space.cpp index 451d93ca813d4ea9bb047fef896ff24ac4df4b6b..ad7416bd299fadd7288833f377cabb8c2d8d5f69 100644 --- a/tests/manual/gdbdebugger/spacy-file/app with space.cpp +++ b/tests/manual/gdbdebugger/spacy-file/app with space.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/gdbdebugger/spacy-file/plugin with space.cpp b/tests/manual/gdbdebugger/spacy-file/plugin with space.cpp index 90c1ffd562f4016c3f0ec6e913ec37420f7c50ae..4e02c7f9f7e5628c7b000cfa93a41684dc0905d8 100644 --- a/tests/manual/gdbdebugger/spacy-file/plugin with space.cpp +++ b/tests/manual/gdbdebugger/spacy-file/plugin with space.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/progressmanager/main.cpp b/tests/manual/progressmanager/main.cpp index 4375a9f3677e9f5f99b111ca8a85ad6cb2be3f1b..9409fd1179cf4938318f9f4a3ce3a3159245cc9c 100644 --- a/tests/manual/progressmanager/main.cpp +++ b/tests/manual/progressmanager/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/progressmanager/roundprogress.cpp b/tests/manual/progressmanager/roundprogress.cpp index 9a0c03d58db3b81157d106028d97a825a2c97447..bfcc6a13a4b9347676ce955143b478529a3e04f8 100644 --- a/tests/manual/progressmanager/roundprogress.cpp +++ b/tests/manual/progressmanager/roundprogress.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/progressmanager/roundprogress.h b/tests/manual/progressmanager/roundprogress.h index 9f7174b790d60c7fc8b7b6d8fe1c52475725b61f..a2d748178a5af676b9be152249e7acf53200fc35 100644 --- a/tests/manual/progressmanager/roundprogress.h +++ b/tests/manual/progressmanager/roundprogress.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/proparser/main.cpp b/tests/manual/proparser/main.cpp index 2c32a5ec6274b3c30916a25fc716791ec26adba7..08197c56f9a5b45f13d5e3ecb18a0135493b9b06 100644 --- a/tests/manual/proparser/main.cpp +++ b/tests/manual/proparser/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) **