diff --git a/doc/doc.pri b/doc/doc.pri index 4207e364c76..4ed0de99375 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 bde9c816c7c..e1e65631d12 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 10f4620a2cd..869f0e837f8 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 00000000000..50fa37a71a0 --- /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 9b86d8e1cf3..ab95e62b8cd 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 bc8376bbddb..a8cb1a8e9dc 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 479ef576c3b..c10c476991d 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/coreplugin/coreimpl.cpp b/src/plugins/coreplugin/coreimpl.cpp index 9f8ec24b576..e9a3799d628 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/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 93e2cb0b991..bf36602e342 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -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(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/designer/cpp/formclasswizarddialog.cpp b/src/plugins/designer/cpp/formclasswizarddialog.cpp index 748e1b1d021..3dc30d9c83f 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 4c61e5f09c7..13a804fb2f1 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 81c67331de3..a5b2facf1d9 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/formtemplatewizardpage.cpp b/src/plugins/designer/formtemplatewizardpage.cpp index 4a8c9907009..aacda476a16 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 = "\n" "\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 element, as name of the first 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 6b375386b58..3c62b4f15f8 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 d7905a56545..4fef805c2cc 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 0ecd7274b1d..36069b34452 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/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index f6e9d759708..9236b8930bb 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 @@ -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 m_undoGroupStack; // extra data for '.' - QString m_dotCount; QString m_dotCommand; // history for '/' @@ -392,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(); @@ -447,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(); @@ -468,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(); @@ -632,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(); @@ -655,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; @@ -749,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; @@ -774,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(); @@ -828,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(); @@ -916,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"; @@ -972,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"); @@ -987,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(); @@ -1001,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())); @@ -1019,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(); @@ -1085,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(); @@ -1620,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; } @@ -1851,8 +1877,19 @@ void FakeVimHandler::Private::recordInsertText(const QString &data) m_tc.insertText(data); } +void FakeVimHandler::Private::recordMove() +{ + EditOperation op; + op.position = m_tc.position(); + m_undoStack.push(op); + m_redoStack.clear(); + //qDebug() << "MOVE: " << op; + //qDebug() << "\nSTACK: " << m_undoStack; +} + void FakeVimHandler::Private::recordOperation(const EditOperation &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; @@ -1861,14 +1898,7 @@ void FakeVimHandler::Private::recordOperation(const EditOperation &op) return; m_undoStack.push(op); m_redoStack.clear(); -} - -void FakeVimHandler::Private::recordMove(int position, int nestedCount) -{ - EditOperation op; - op.position = position; - op.itemCount = nestedCount; - recordOperation(op); + //qDebug() << "\nSTACK: " << m_undoStack; } void FakeVimHandler::Private::recordInsert(int position, const QString &data) diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index a22cc1f5105..9e07f46f69f 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/qworkbench.pri b/src/qworkbench.pri index 1f842960842..296e2170b3d 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 1ef9b3fbec4..389d513eec9 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 e598570259a..25e02ae4747 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 00000000000..e6812dbc23a --- /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 00000000000..e2fd4cc2f2e --- /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 +#include +#include + +#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 00000000000..a6867d39fbd --- /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 + +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 00000000000..fb0b51c9c9e --- /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 00000000000..975e58c971a --- /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 +#include + +#include +#include +#include +#include +#include + +#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 451d93ca813..ad7416bd299 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 90c1ffd562f..4e02c7f9f7e 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 4375a9f3677..9409fd1179c 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 9a0c03d58db..bfcc6a13a4b 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 9f7174b790d..a2d748178a5 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 2c32a5ec627..08197c56f9a 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) **