diff options
author | Eike Ziller <eike.ziller@digia.com> | 2012-09-27 20:38:57 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2012-09-27 20:38:57 +0200 |
commit | 6faede0860db6fad0645dc36ea817df0b95b7cbc (patch) | |
tree | da52693f995479bf0b0f8cf25fd4cf4da3c0f857 /src/plugins | |
parent | a299252ae5938e33b797e4b6e5014465709584bf (diff) | |
parent | 14a2ff598aec6af17299580468e75a95055c8894 (diff) | |
download | qt-creator-6faede0860db6fad0645dc36ea817df0b95b7cbc.tar.gz |
Merge remote-tracking branch 'origin/2.6'
Conflicts:
share/qtcreator/qml/qmlpuppet/commands/changenodesourcecommand.h
share/qtcreator/qml/qmlpuppet/commands/tokencommand.h
share/qtcreator/qml/qmlpuppet/container/reparentcontainer.h
share/qtcreator/qml/qmlpuppet/qml2puppet/instances/componentnodeinstance.h
share/qtcreator/qml/qmlpuppet/qmlpuppet/instances/nodeinstanceclientproxy.cpp
src/plugins/git/gitsettings.cpp
tests/manual/ssh/remoteprocess/remoteprocesstest.h
Change-Id: I00c294e6d911d272615e65fed58562399af97a4e
Diffstat (limited to 'src/plugins')
41 files changed, 193 insertions, 156 deletions
diff --git a/src/plugins/autotoolsprojectmanager/makestep.cpp b/src/plugins/autotoolsprojectmanager/makestep.cpp index 08c06f4cbc..7340806012 100644 --- a/src/plugins/autotoolsprojectmanager/makestep.cpp +++ b/src/plugins/autotoolsprojectmanager/makestep.cpp @@ -44,6 +44,8 @@ #include <projectexplorer/kitinformation.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> +#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtparser.h> #include <utils/qtcprocess.h> #include <QVariantMap> @@ -193,6 +195,9 @@ bool MakeStep::init() pp->setArguments(arguments); setOutputParser(new GnuMakeParser()); + QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); + if (version) + appendOutputParser(new QtSupport::QtParser); if (tc) appendOutputParser(tc->outputParser()); outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index 5f3d52ea99..f857843fe0 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -71,8 +71,6 @@ #include <QDir> #include <QDialog> #include <QFileDialog> -#include <QTemporaryFile> - using namespace Bazaar::Internal; using namespace Bazaar; @@ -123,10 +121,10 @@ BazaarPlugin::BazaarPlugin() m_optionsPage(0), m_client(0), m_commandLocator(0), - m_changeLog(0), m_addAction(0), m_deleteAction(0), - m_menuAction(0) + m_menuAction(0), + m_submitActionTriggered(false) { m_instance = this; } @@ -138,8 +136,6 @@ BazaarPlugin::~BazaarPlugin() m_client = 0; } - deleteCommitLog(); - m_instance = 0; } @@ -552,20 +548,16 @@ void BazaarPlugin::showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusIt return; } - deleteCommitLog(); - - // Open commit log - QString changeLogPattern = QDir::tempPath(); - if (!changeLogPattern.endsWith(QLatin1Char('/'))) - changeLogPattern += QLatin1Char('/'); - changeLogPattern += QLatin1String("qtcreator-bzr-XXXXXX.msg"); - m_changeLog = new QTemporaryFile(changeLogPattern, this); - if (!m_changeLog->open()) { - outputWindow->appendError(tr("Unable to generate a temporary file for the commit editor.")); + // Start new temp file + Utils::TempFileSaver saver; + // Keep the file alive, else it removes self and forgets its name + saver.setAutoRemove(false); + if (!saver.finalize()) { + VcsBase::VcsBaseOutputWindow::instance()->append(saver.errorString()); return; } - Core::IEditor *editor = Core::EditorManager::openEditor(m_changeLog->fileName(), + Core::IEditor *editor = Core::EditorManager::openEditor(saver.fileName(), Constants::COMMIT_ID, Core::EditorManager::ModeSwitch); if (!editor) { @@ -602,17 +594,13 @@ void BazaarPlugin::diffFromEditorSelected(const QStringList &files) void BazaarPlugin::commitFromEditor() { - if (!m_changeLog) - return; - - //use the same functionality than if the user closes the file without completing the commit - Core::ICore::editorManager()->closeEditors(Core::ICore::editorManager()->editorsForFileName(m_changeLog->fileName())); + // Close the submit editor + m_submitActionTriggered = true; + Core::ICore::editorManager()->closeEditor(); } bool BazaarPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor) { - if (!m_changeLog) - return true; Core::IDocument *editorDocument = submitEditor->document(); const CommitEditor *commitEditor = qobject_cast<const CommitEditor *>(submitEditor); if (!editorDocument || !commitEditor) @@ -622,13 +610,13 @@ bool BazaarPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submit const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult response = commitEditor->promptSubmit(tr("Close Commit Editor"), tr("Do you want to commit the changes?"), tr("Message check failed. Do you want to proceed?"), - &dummyPrompt, dummyPrompt); + &dummyPrompt, !m_submitActionTriggered); + m_submitActionTriggered = false; switch (response) { case VcsBase::VcsBaseSubmitEditor::SubmitCanceled: return false; case VcsBase::VcsBaseSubmitEditor::SubmitDiscarded: - deleteCommitLog(); return true; default: break; @@ -666,14 +654,6 @@ bool BazaarPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submit return true; } -void BazaarPlugin::deleteCommitLog() -{ - if (m_changeLog) { - delete m_changeLog; - m_changeLog = 0; - } -} - void BazaarPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) { if (!enableMenuAction(as, m_menuAction)) { diff --git a/src/plugins/bazaar/bazaarplugin.h b/src/plugins/bazaar/bazaarplugin.h index 0cda4e3b51..1677b03de5 100644 --- a/src/plugins/bazaar/bazaarplugin.h +++ b/src/plugins/bazaar/bazaarplugin.h @@ -44,7 +44,6 @@ QT_BEGIN_NAMESPACE class QAction; -class QTemporaryFile; QT_END_NAMESPACE namespace Core { @@ -127,7 +126,6 @@ private: void createFileActions(const Core::Context &context); void createDirectoryActions(const Core::Context &context); void createRepositoryActions(const Core::Context &context); - void deleteCommitLog(); // Variables static BazaarPlugin *m_instance; @@ -139,7 +137,6 @@ private: Core::ActionContainer *m_bazaarContainer; QList<QAction *> m_repositoryActionList; - QTemporaryFile *m_changeLog; // Menu Items (file actions) Utils::ParameterAction *m_addAction; @@ -159,6 +156,7 @@ private: QAction *m_menuAction; QString m_submitRepository; + bool m_submitActionTriggered; }; } // namespace Internal diff --git a/src/plugins/bineditor/bineditor.cpp b/src/plugins/bineditor/bineditor.cpp index 6ccd1a013b..488fd8e5d9 100644 --- a/src/plugins/bineditor/bineditor.cpp +++ b/src/plugins/bineditor/bineditor.cpp @@ -1051,7 +1051,8 @@ bool BinEditor::event(QEvent *e) return true; case Qt::Key_Down: { const QScrollBar * const scrollBar = verticalScrollBar(); - if (scrollBar->value() >= scrollBar->maximum() - 1) { + const int maximum = scrollBar->maximum(); + if (maximum && scrollBar->value() >= maximum - 1) { emit newRangeRequested(editor(), baseAddress() + m_size); return true; } diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 7b5d5f8a74..ce28543c22 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -222,10 +222,17 @@ public: bool open(QString *errorString, const QString &fileName, quint64 offset = 0) { QFile file(fileName); - if (offset >= static_cast<quint64>(file.size())) { - *errorString = tr("The Binary Editor can not open empty files."); + quint64 size = static_cast<quint64>(file.size()); + if (size == 0) { + QString msg = tr("The Binary Editor can not open empty files."); + if (errorString) + *errorString = msg; + else + QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), msg); return false; } + if (offset >= size) + return false; if (file.open(QIODevice::ReadOnly)) { file.close(); m_fileName = fileName; diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index 8a5e963c92..7c9bcd4b40 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -43,6 +43,9 @@ #include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> +#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtparser.h> + #include <utils/qtcprocess.h> #include <QFormLayout> @@ -198,6 +201,10 @@ bool MakeStep::init() pp->setArguments(arguments); setOutputParser(new ProjectExplorer::GnuMakeParser()); + + QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); + if (version) + appendOutputParser(new QtSupport::QtParser); if (tc) appendOutputParser(tc->outputParser()); outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro index aa71fbafcc..fa66556673 100644 --- a/src/plugins/debugger/debugger.pro +++ b/src/plugins/debugger/debugger.pro @@ -161,9 +161,10 @@ include(namedemangler/namedemangler.pri) include(shared/shared.pri) equals(TEST, 1):!isEmpty(copydata) { - TEST_DIR = ../../../tests/manual/debugger/simple - INPUT_FILE = $$PWD/$$TEST_DIR/simple.pro - OUTPUT_DIR = $$OUT_PWD/$$TEST_DIR + TEST_DIR = tests/manual/debugger/simple + INPUT_FILE = $$IDE_SOURCE_TREE/$$TEST_DIR/simple.pro + macx: OUTPUT_DIR = $$IDE_DATA_PATH/$$TEST_DIR + else: OUTPUT_DIR = $$IDE_BUILD_TREE/$$TEST_DIR win32 { INPUT_FILE ~= s,/,\\\\,g OUTPUT_DIR ~= s,/,\\\\,g @@ -171,8 +172,8 @@ equals(TEST, 1):!isEmpty(copydata) { isEmpty(QMAKE_CHK_EXISTS_GLUE):QMAKE_CHK_EXISTS_GLUE = "|| " } testfile.target = test_resources - testfile.commands = ($$QMAKE_CHK_DIR_EXISTS $$OUTPUT_DIR $$QMAKE_CHK_EXISTS_GLUE $$QMAKE_MKDIR $$OUTPUT_DIR) \ - && $$QMAKE_COPY $$INPUT_FILE $$OUTPUT_DIR + testfile.commands = ($$QMAKE_CHK_DIR_EXISTS \"$$OUTPUT_DIR\" $$QMAKE_CHK_EXISTS_GLUE $$QMAKE_MKDIR \"$$OUTPUT_DIR\") \ + && $$QMAKE_COPY \"$$INPUT_FILE\" \"$$OUTPUT_DIR\" QMAKE_EXTRA_TARGETS += testfile PRE_TARGETDEPS += $$testfile.target } diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 95d029ecde..5b86f09c32 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -173,8 +173,9 @@ DebuggerKitInformation::DebuggerItem DebuggerKitInformation::autoDetectItem(cons } // Check suggestions from the SDK. - const Environment env = Environment::systemEnvironment(); + Environment env = Environment::systemEnvironment(); if (tc) { + tc->addToEnvironment(env); // Find MinGW gdb in toolchain environment. QString path = tc->suggestedDebugger().toString(); if (!path.isEmpty()) { const QFileInfo fi(path); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 3a35c1f334..a6431b0c1f 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -3530,7 +3530,10 @@ void DebuggerPluginPrivate::testPythonDumpers1() { m_testSuccess = true; QString proFile = ICore::resourcePath() - + QLatin1String("/../../tests/manual/debugger/simple/simple.pro"); +#ifndef Q_OS_MAC + + QLatin1String("/../..") +#endif + + QLatin1String("/tests/manual/debugger/simple/simple.pro"); testLoadProject(proFile, TestCallBack(this, "testPythonDumpers2")); QVERIFY(m_testSuccess); QTestEventLoop::instance().enterLoop(20); diff --git a/src/plugins/debugger/ptracepreload.qbs b/src/plugins/debugger/ptracepreload.qbs new file mode 100644 index 0000000000..3e2de1517b --- /dev/null +++ b/src/plugins/debugger/ptracepreload.qbs @@ -0,0 +1,18 @@ +import qbs.base 1.0 +import "../../libs/QtcLibrary.qbs" as QtcLibrary + +QtcLibrary { + name: "ptracepreload" + condition: qbs.targetOS == "linux" + + cpp.dynamicLibraries: [ + "dl", + "c" + ] + + Depends { name: "cpp" } + + files: [ + "ptracepreload.c", + ] +} diff --git a/src/plugins/genericprojectmanager/genericmakestep.cpp b/src/plugins/genericprojectmanager/genericmakestep.cpp index 1969072ac4..bca124168c 100644 --- a/src/plugins/genericprojectmanager/genericmakestep.cpp +++ b/src/plugins/genericprojectmanager/genericmakestep.cpp @@ -41,6 +41,8 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/toolchain.h> +#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtparser.h> #include <coreplugin/variablemanager.h> #include <utils/stringutils.h> #include <utils/qtcassert.h> @@ -128,6 +130,9 @@ bool GenericMakeStep::init() setIgnoreReturnValue(m_clean); setOutputParser(new GnuMakeParser()); + QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); + if (version) + appendOutputParser(new QtSupport::QtParser); if (tc) appendOutputParser(tc->outputParser()); outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index aef4c078b5..91b58fc121 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -65,7 +65,6 @@ #include <vcsbase/vcsbaseplugin.h> #include <QRegExp> -#include <QTemporaryFile> #include <QTime> #include <QFileInfo> #include <QDir> diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 6371241a4c..6647b5a1a7 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -74,7 +74,6 @@ #include <QDebug> #include <QDir> #include <QFileInfo> -#include <QTemporaryFile> #include <QtPlugin> #include <QAction> @@ -717,9 +716,7 @@ void GitPlugin::submitCurrentLog() { // Close the submit editor m_submitActionTriggered = true; - QList<Core::IEditor*> editors; - editors.push_back(Core::EditorManager::currentEditor()); - Core::ICore::editorManager()->closeEditors(editors); + Core::ICore::editorManager()->closeEditor(); } bool GitPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor) diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 5d61a3c966..cab05b01ef 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -31,14 +31,11 @@ #include "gitsettings.h" #include <utils/hostosinfo.h> -#include <utils/synchronousprocess.h> - #include <QCoreApplication> namespace Git { namespace Internal { -const QLatin1String GitSettings::pathKey("Path"); const QLatin1String GitSettings::pullRebaseKey("PullRebase"); const QLatin1String GitSettings::omitAnnotationDateKey("OmitAnnotationDate"); const QLatin1String GitSettings::ignoreSpaceChangesInDiffKey("SpaceIgnorantDiff"); @@ -56,7 +53,6 @@ GitSettings::GitSettings() declareKey(binaryPathKey, QLatin1String("git")); declareKey(timeoutKey, Utils::HostOsInfo::isWindowsHost() ? 60 : 30); - declareKey(pathKey, QString()); declareKey(pullRebaseKey, false); declareKey(omitAnnotationDateKey, false); declareKey(ignoreSpaceChangesInDiffKey, true); @@ -78,33 +74,21 @@ QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const if (errorMessage) errorMessage->clear(); - if (m_binaryPath.isEmpty()) { - const QString binary = binaryPath(); - QString currentPath = stringValue(pathKey); - QString systemPath = QString::fromLocal8Bit(qgetenv("PATH")); - if (!systemPath.isEmpty()) { - if (!currentPath.isEmpty()) - currentPath.append(Utils::HostOsInfo::pathListSeparator()); - currentPath.append(systemPath); - } - // Search in path? - m_binaryPath = Utils::SynchronousProcess::locateBinary(currentPath, binary); - if (m_binaryPath.isEmpty()) { - if (ok) - *ok = false; - if (errorMessage) - *errorMessage = QCoreApplication::translate("Git::Internal::GitSettings", - "The binary '%1' could not be located in the path '%2'") - .arg(binary, currentPath); - } + QString binPath = binaryPath(); + if (binPath.isEmpty()) { + if (ok) + *ok = false; + if (errorMessage) + *errorMessage = QCoreApplication::translate("Git::Internal::GitSettings", + "The binary '%1' could not be located in the path '%2'") + .arg(stringValue(binaryPathKey), stringValue(pathKey)); } - return m_binaryPath; + return binPath; } GitSettings &GitSettings::operator = (const GitSettings &s) { VcsBaseClientSettings::operator =(s); - m_binaryPath.clear(); return *this; } diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index b4340f289b..5b9e988136 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -44,7 +44,6 @@ class GitSettings : public VcsBase::VcsBaseClientSettings public: GitSettings(); - static const QLatin1String pathKey; static const QLatin1String pullRebaseKey; static const QLatin1String omitAnnotationDateKey; static const QLatin1String ignoreSpaceChangesInDiffKey; @@ -59,9 +58,6 @@ public: QString gitBinaryPath(bool *ok = 0, QString *errorMessage = 0) const; GitSettings &operator = (const GitSettings &s); - -private: - mutable QString m_binaryPath; }; } // namespace Internal diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index 1c8e5e9f3b..f28cb65f64 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -68,8 +68,6 @@ #include <QDir> #include <QDialog> #include <QFileDialog> -#include <QTemporaryFile> - using namespace Mercurial::Internal; using namespace Mercurial; @@ -122,11 +120,11 @@ MercurialPlugin::MercurialPlugin() : m_client(0), core(0), m_commandLocator(0), - changeLog(0), m_addAction(0), m_deleteAction(0), m_createRepositoryAction(0), - m_menuAction(0) + m_menuAction(0), + m_submitActionTriggered(false) { m_instance = this; } @@ -138,8 +136,6 @@ MercurialPlugin::~MercurialPlugin() m_client = 0; } - deleteCommitLog(); - m_instance = 0; } @@ -553,7 +549,6 @@ void MercurialPlugin::commit() void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &status) { - VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance(); //Once we receive our data release the connection so it can be reused elsewhere disconnect(m_client, SIGNAL(parsedStatus(QList<VcsBase::VcsBaseClient::StatusItem>)), @@ -564,20 +559,16 @@ void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &s return; } - deleteCommitLog(); - - // Open commit log - QString changeLogPattern = QDir::tempPath(); - if (!changeLogPattern.endsWith(QLatin1Char('/'))) - changeLogPattern += QLatin1Char('/'); - changeLogPattern += QLatin1String("qtcreator-hg-XXXXXX.msg"); - changeLog = new QTemporaryFile(changeLogPattern, this); - if (!changeLog->open()) { - outputWindow->appendError(tr("Unable to generate a temporary file for the commit editor.")); + // Start new temp file + Utils::TempFileSaver saver; + // Keep the file alive, else it removes self and forgets its name + saver.setAutoRemove(false); + if (!saver.finalize()) { + VcsBase::VcsBaseOutputWindow::instance()->append(saver.errorString()); return; } - Core::IEditor *editor = Core::EditorManager::openEditor(changeLog->fileName(), + Core::IEditor *editor = Core::EditorManager::openEditor(saver.fileName(), Constants::COMMIT_ID, Core::EditorManager::ModeSwitch); if (!editor) { @@ -610,17 +601,13 @@ void MercurialPlugin::diffFromEditorSelected(const QStringList &files) void MercurialPlugin::commitFromEditor() { - if (!changeLog) - return; - - //use the same functionality than if the user closes the file without completing the commit - core->editorManager()->closeEditors(core->editorManager()->editorsForFileName(changeLog->fileName())); + // Close the submit editor + m_submitActionTriggered = true; + Core::ICore::editorManager()->closeEditor(); } bool MercurialPlugin::submitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor) { - if (!changeLog) - return true; Core::IDocument *editorFile = submitEditor->document(); CommitEditor *commitEditor = qobject_cast<CommitEditor *>(submitEditor); if (!editorFile || !commitEditor) @@ -630,13 +617,13 @@ bool MercurialPlugin::submitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor const VcsBaseSubmitEditor::PromptSubmitResult response = commitEditor->promptSubmit(tr("Close Commit Editor"), tr("Do you want to commit the changes?"), tr("Message check failed. Do you want to proceed?"), - &dummyPrompt, dummyPrompt); + &dummyPrompt, !m_submitActionTriggered); + m_submitActionTriggered = false; switch (response) { case VcsBaseSubmitEditor::SubmitCanceled: return false; case VcsBaseSubmitEditor::SubmitDiscarded: - deleteCommitLog(); return true; default: break; @@ -657,14 +644,6 @@ bool MercurialPlugin::submitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor return true; } -void MercurialPlugin::deleteCommitLog() -{ - if (changeLog) { - delete changeLog; - changeLog = 0; - } -} - void MercurialPlugin::createRepositoryManagementActions(const Core::Context &context) { //TODO create menu for these options diff --git a/src/plugins/mercurial/mercurialplugin.h b/src/plugins/mercurial/mercurialplugin.h index 0ef33adc91..4b994ffc85 100644 --- a/src/plugins/mercurial/mercurialplugin.h +++ b/src/plugins/mercurial/mercurialplugin.h @@ -39,7 +39,6 @@ QT_BEGIN_NAMESPACE class QAction; -class QTemporaryFile; QT_END_NAMESPACE namespace Core { @@ -132,7 +131,6 @@ private: void createRepositoryActions(const Core::Context &context); void createRepositoryManagementActions(const Core::Context &context); void createLessUsedActions(const Core::Context &context); - void deleteCommitLog(); // Variables static MercurialPlugin *m_instance; @@ -145,7 +143,6 @@ private: Core::ActionContainer *mercurialContainer; QList<QAction *> m_repositoryActionList; - QTemporaryFile *changeLog; // Menu items (file actions) Utils::ParameterAction *m_addAction; @@ -166,6 +163,8 @@ private: QAction *m_menuAction; QString m_submitRepository; + + bool m_submitActionTriggered; }; } // namespace Internal diff --git a/src/plugins/perforce/perforceplugin.h b/src/plugins/perforce/perforceplugin.h index 81eeea57fd..b0549fc7fd 100644 --- a/src/plugins/perforce/perforceplugin.h +++ b/src/plugins/perforce/perforceplugin.h @@ -47,7 +47,6 @@ QT_BEGIN_NAMESPACE class QFile; class QAction; class QTextCodec; -class QTemporaryFile; QT_END_NAMESPACE namespace Utils { diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index d1aa4b0880..e90cd6dfe8 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -42,6 +42,7 @@ #include <utils/persistentsettings.h> #include <utils/environment.h> +#include <utils/qtcassert.h> #include <QCoreApplication> #include <QDir> @@ -91,7 +92,7 @@ public: KitManagerPrivate::KitManagerPrivate() : m_defaultKit(0), m_initialized(false), - m_writer(new Utils::PersistentSettingsWriter(settingsFileName(), QLatin1String("QtCreatorProfiles"))) + m_writer(0) { } KitManagerPrivate::~KitManagerPrivate() @@ -148,6 +149,7 @@ KitManager::KitManager(QObject *parent) : void KitManager::restoreKits() { + QTC_ASSERT(!d->m_writer, return); QList<Kit *> kitsToRegister; QList<Kit *> kitsToCheck; @@ -213,6 +215,8 @@ void KitManager::restoreKits() Kit *k = find(userKits.defaultKit); if (k) setDefaultKit(k); + + d->m_writer = new Utils::PersistentSettingsWriter(settingsFileName(), QLatin1String("QtCreatorProfiles")); } KitManager::~KitManager() @@ -224,7 +228,7 @@ KitManager::~KitManager() void KitManager::saveKits() { - if (!d->m_initialized) // ignore save requests while we are not initialized. + if (!d->m_writer) // ignore save requests while we are not initialized. return; QVariantMap data; diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index 5a9eb58870..158c7401ac 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -39,6 +39,7 @@ #include <extensionsystem/pluginmanager.h> #include <utils/persistentsettings.h> +#include <utils/qtcassert.h> #include <QCoreApplication> #include <QDir> @@ -81,7 +82,6 @@ public: QList<ToolChain *> &toolChains(); ToolChainManager *q; - bool m_initialized; QMap<QString, Utils::FileName> m_abiToDebugger; Utils::PersistentSettingsWriter *m_writer; @@ -90,8 +90,7 @@ private: }; ToolChainManagerPrivate::ToolChainManagerPrivate(ToolChainManager *parent) - : q(parent), m_initialized(false), - m_writer(new Utils::PersistentSettingsWriter(settingsFileName(QLatin1String(TOOLCHAIN_FILENAME)), QLatin1String("QtCreatorToolChains"))) + : q(parent), m_writer(0) { } ToolChainManagerPrivate::~ToolChainManagerPrivate() @@ -99,10 +98,8 @@ ToolChainManagerPrivate::~ToolChainManagerPrivate() QList<ToolChain *> &ToolChainManagerPrivate::toolChains() { - if (!m_initialized) { - m_initialized = true; + if (!m_writer) q->restoreToolChains(); - } return m_toolChains; } @@ -136,6 +133,10 @@ ToolChainManager::ToolChainManager(QObject *parent) : void ToolChainManager::restoreToolChains() { + QTC_ASSERT(!d->m_writer, return); + d->m_writer = + new Utils::PersistentSettingsWriter(settingsFileName(QLatin1String(TOOLCHAIN_FILENAME)), QLatin1String("QtCreatorToolChains")); + QList<ToolChain *> tcsToRegister; QList<ToolChain *> tcsToCheck; diff --git a/src/plugins/qmldesigner/components/itemlibrary/qml/ItemView.qml b/src/plugins/qmldesigner/components/itemlibrary/qml/ItemView.qml index 8fe77e41fa..a03ac687af 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/qml/ItemView.qml +++ b/src/plugins/qmldesigner/components/itemlibrary/qml/ItemView.qml @@ -28,7 +28,7 @@ ** **************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 // view displaying an item library grid item diff --git a/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsView.qml b/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsView.qml index f960860dae..b691a8133d 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsView.qml +++ b/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsView.qml @@ -28,7 +28,7 @@ ** **************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 /* The view displaying the item grid. diff --git a/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsViewStyle.qml b/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsViewStyle.qml index 679a65ace2..4dfb36549e 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsViewStyle.qml +++ b/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsViewStyle.qml @@ -28,7 +28,7 @@ ** **************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 // the style used the items view diff --git a/src/plugins/qmldesigner/components/itemlibrary/qml/Scrollbar.qml b/src/plugins/qmldesigner/components/itemlibrary/qml/Scrollbar.qml index a505303915..1a7d69c7da 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/qml/Scrollbar.qml +++ b/src/plugins/qmldesigner/components/itemlibrary/qml/Scrollbar.qml @@ -28,7 +28,7 @@ ** **************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 // scrollbar for the items view diff --git a/src/plugins/qmldesigner/components/itemlibrary/qml/SectionView.qml b/src/plugins/qmldesigner/components/itemlibrary/qml/SectionView.qml index 7bb5fb65e6..c066ea728c 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/qml/SectionView.qml +++ b/src/plugins/qmldesigner/components/itemlibrary/qml/SectionView.qml @@ -28,7 +28,7 @@ ** **************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 // view displaying one item library section including its grid diff --git a/src/plugins/qmldesigner/components/itemlibrary/qml/Selector.qml b/src/plugins/qmldesigner/components/itemlibrary/qml/Selector.qml index 0bd4a0b131..cd2b586ae2 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/qml/Selector.qml +++ b/src/plugins/qmldesigner/components/itemlibrary/qml/Selector.qml @@ -28,7 +28,7 @@ ** **************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 // the coloured selector of the items view diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp index e4febdb36b..f068b7819f 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp @@ -1294,7 +1294,12 @@ void QGroupBoxDeclarativeUI::collapse() m_oldMinHeight =gb->minimumHeight(); if (!m_expanded) return; - m_contens = QPixmap::grabWidget (gb, 5, 5, gb->width() - 5, gb->height() - 5); + +#if QT_VERSION < 0x050000 + m_contens = QPixmap::grabWidget(gb, 5, 5, gb->width() - 5, gb->height() - 5); +#else + m_contens = gb->grab(QRect(5, 5, gb->width() - 5, gb->height() - 5)); +#endif gb->setPixmap(m_contens,1); hideChildren(); m_expanded = false; diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp index e926ab1e69..275506ff7f 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp @@ -625,7 +625,7 @@ void PropertyEditor::timerEvent(QTimerEvent *timerEvent) QString templateGeneration(NodeMetaInfo type, NodeMetaInfo superType, const QmlObjectNode &objectNode) { - QString qmlTemplate = QLatin1String("import Qt 4.7\nimport Bauhaus 1.0\n"); + QString qmlTemplate = QLatin1String("import QtQuick 1.0\nimport Bauhaus 1.0\n"); qmlTemplate += QLatin1String("GroupBox {\n"); qmlTemplate += QString(QLatin1String("caption: \"%1\"\n")).arg(objectNode.modelNode().simplifiedTypeName()); qmlTemplate += QLatin1String("layout: VerticalLayout {\n"); diff --git a/src/plugins/qmldesigner/components/stateseditor/HorizontalScrollBar.qml b/src/plugins/qmldesigner/components/stateseditor/HorizontalScrollBar.qml index 02bf9dbbca..6116d68571 100644 --- a/src/plugins/qmldesigner/components/stateseditor/HorizontalScrollBar.qml +++ b/src/plugins/qmldesigner/components/stateseditor/HorizontalScrollBar.qml @@ -28,7 +28,7 @@ ** **************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 Item { property variant flickable: this; diff --git a/src/plugins/qmldesigner/components/stateseditor/stateslist.qml b/src/plugins/qmldesigner/components/stateseditor/stateslist.qml index d61f91b0b1..6a080ec36b 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateslist.qml +++ b/src/plugins/qmldesigner/components/stateseditor/stateslist.qml @@ -28,7 +28,7 @@ ** **************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 Rectangle { id: root diff --git a/src/plugins/qmldesigner/qmldesigner.qbs b/src/plugins/qmldesigner/qmldesigner.qbs index 38ccef778d..bdc381c813 100644 --- a/src/plugins/qmldesigner/qmldesigner.qbs +++ b/src/plugins/qmldesigner/qmldesigner.qbs @@ -110,7 +110,7 @@ QtcPlugin { "designercore/model/internalnode_p.h", "designercore/model/model_p.h", "designercore/model/painteventfilter_p.h", - "designercore/model/propertyparser.h", + "designercore/include/propertyparser.h", "designercore/pluginmanager/widgetpluginmanager.h", "designercore/pluginmanager/widgetpluginpath.h", "designercore/include/exception.h", @@ -122,7 +122,6 @@ QtcPlugin { "designercore/include/invalidmodelstateexception.h", "designercore/include/removebasestateexception.h", "designercore/include/invalididexception.h", - "designercore/model/variantparser.h", "designercore/include/propertynode.h", "designercore/include/invalidslideindexexception.h", "designercore/include/import.h", @@ -359,7 +358,6 @@ QtcPlugin { "designercore/exceptions/invalidmetainfoexception.cpp", "designercore/exceptions/invalidargumentexception.cpp", "designercore/exceptions/notimplementedexception.cpp", - "designercore/model/variantparser.cpp", "designercore/exceptions/invalidmodelstateexception.cpp", "designercore/exceptions/removebasestateexception.cpp", "designercore/exceptions/invalididexception.cpp", diff --git a/src/plugins/qmljstools/qmljstools_test.cpp b/src/plugins/qmljstools/qmljstools_test.cpp index 80fecfca6c..430638771b 100644 --- a/src/plugins/qmljstools/qmljstools_test.cpp +++ b/src/plugins/qmljstools/qmljstools_test.cpp @@ -80,10 +80,6 @@ void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic() QVERIFY(ovItem); QCOMPARE(ovItem->className(), QString("Item")); QCOMPARE(context->imports(doc.data())->info("Item", context.data()).name(), QString("QtQuick")); - const ObjectValue *ovTabWidget = context->lookupType(doc.data(), QStringList() << "TabWidget"); - QVERIFY(ovTabWidget); - QCOMPARE(ovTabWidget->className(), QString("TabWidget")); - QCOMPARE(ovTabWidget->prototype(context)->className(), QString("Item")); const ObjectValue *ovProperty = context->lookupType(doc.data(), QStringList() << "Item" << "states"); QVERIFY(ovProperty); diff --git a/src/plugins/qtsupport/qtparser.cpp b/src/plugins/qtsupport/qtparser.cpp index b96b91b8fe..b6e18e146a 100644 --- a/src/plugins/qtsupport/qtparser.cpp +++ b/src/plugins/qtsupport/qtparser.cpp @@ -135,6 +135,15 @@ void QtSupportPlugin::testQtOutputParser_data() Utils::FileName::fromUserInput(QLatin1String("c:\\code\\test.h")), 96, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) << QString(); + QTest::newRow("ninja with moc") + << QString::fromLatin1("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h(54): Error: Undefined interface") + << OutputParserTester::STDERR + << QString() << QString() + << (QList<ProjectExplorer::Task>() << Task(Task::Error, + QLatin1String("Undefined interface"), + Utils::FileName::fromUserInput(QLatin1String("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h")), 54, + Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) + << QString(); } void QtSupportPlugin::testQtOutputParser() diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 81fa5b99b6..c4db1ff07d 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -177,6 +177,10 @@ QtVersionManager *QtVersionManager::instance() bool QtVersionManager::restoreQtVersions() { + QTC_ASSERT(!m_writer, return false); + m_writer = new Utils::PersistentSettingsWriter(settingsFileName(QLatin1String(QTVERSION_FILENAME)), + QLatin1String("QtCreatorQtVersions")); + QList<QtVersionFactory *> factories = ExtensionSystem::PluginManager::getObjects<QtVersionFactory>(); Utils::PersistentSettingsReader reader; @@ -362,8 +366,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) void QtVersionManager::saveQtVersions() { if (!m_writer) - m_writer = new Utils::PersistentSettingsWriter(settingsFileName(QLatin1String(QTVERSION_FILENAME)), - QLatin1String("QtCreatorQtVersions")); + return; QVariantMap data; data.insert(QLatin1String(QTVERSION_FILE_VERSION_KEY), 1); @@ -388,8 +391,10 @@ void QtVersionManager::findSystemQt() return; BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(systemQMakePath); - version->setDisplayName(BaseQtVersion::defaultDisplayName(version->qtVersionString(), systemQMakePath, true)); - m_versions.insert(version->uniqueId(), version); + if (version) { + version->setDisplayName(BaseQtVersion::defaultDisplayName(version->qtVersionString(), systemQMakePath, true)); + m_versions.insert(version->uniqueId(), version); + } } void QtVersionManager::addVersion(BaseQtVersion *version) diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 8b160b9279..7f960bc7a7 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -66,7 +66,6 @@ #include <QDebug> #include <QDir> #include <QFileInfo> -#include <QTemporaryFile> #include <QTextCodec> #include <QtPlugin> #include <QProcessEnvironment> diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 1d6a55861c..41248a1937 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -2096,7 +2096,12 @@ QChar BaseTextEditorWidget::characterAt(int pos) const bool BaseTextEditorWidget::event(QEvent *e) { +#if QT_VERSION >= 0x050000 + if (e->type() != QEvent::InputMethodQuery) + d->m_contentsChanged = false; +#else d->m_contentsChanged = false; +#endif switch (e->type()) { case QEvent::ShortcutOverride: if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape && d->m_snippetOverlay->isVisible()) { diff --git a/src/plugins/updateinfo/updateinfo.qbs b/src/plugins/updateinfo/updateinfo.qbs new file mode 100644 index 0000000000..716ff5e686 --- /dev/null +++ b/src/plugins/updateinfo/updateinfo.qbs @@ -0,0 +1,26 @@ +import qbs.base 1.0 + +import "../QtcPlugin.qbs" as QtcPlugin + +QtcPlugin { + name: "UpdateInfo" + + Depends { name: "Core" } + Depends { name: "ExtensionSystem" } + Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] } + + property bool enable: false + property var pluginspecreplacements: ({"UPDATEINFO_EXPERIMENTAL_STR": (enable ? "false": "true")}) + + cpp.includePaths: [ + "..", + buildDirectory, + ] + + files: [ + "updateinfobutton.cpp", + "updateinfobutton.h", + "updateinfoplugin.cpp", + "updateinfoplugin.h" + ] +} diff --git a/src/plugins/vcsbase/submiteditorfile.cpp b/src/plugins/vcsbase/submiteditorfile.cpp index b632fded40..ac811c2027 100644 --- a/src/plugins/vcsbase/submiteditorfile.cpp +++ b/src/plugins/vcsbase/submiteditorfile.cpp @@ -55,8 +55,10 @@ void SubmitEditorFile::rename(const QString &newName) void SubmitEditorFile::setFileName(const QString &name) { - m_fileName = name; - emit changed(); + if (m_fileName == name) + return; + m_fileName = name; + emit changed(); } void SubmitEditorFile::setModified(bool modified) diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index e71b242e2a..ae4c48154e 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -31,6 +31,8 @@ #include "vcsbaseclientsettings.h" #include <utils/environment.h> +#include <utils/hostosinfo.h> +#include <utils/synchronousprocess.h> #include <QSettings> @@ -175,7 +177,7 @@ public: QHash<QString, SettingValue> m_valueHash; QVariantHash m_defaultValueHash; QString m_settingsGroup; - QString m_binaryFullPath; + mutable QString m_binaryFullPath; }; } // namespace Internal @@ -194,6 +196,7 @@ const QLatin1String VcsBaseClientSettings::userEmailKey("UserEmail"); const QLatin1String VcsBaseClientSettings::logCountKey("LogCount"); const QLatin1String VcsBaseClientSettings::promptOnSubmitKey("PromptOnSubmit"); const QLatin1String VcsBaseClientSettings::timeoutKey("Timeout"); +const QLatin1String VcsBaseClientSettings::pathKey("Path"); VcsBaseClientSettings::VcsBaseClientSettings() : d(new Internal::VcsBaseClientSettingsPrivate) @@ -204,6 +207,7 @@ VcsBaseClientSettings::VcsBaseClientSettings() : declareKey(logCountKey, 100); declareKey(promptOnSubmitKey, true); declareKey(timeoutKey, 30); + declareKey(pathKey, QString()); } VcsBaseClientSettings::VcsBaseClientSettings(const VcsBaseClientSettings &other) : @@ -332,8 +336,7 @@ void VcsBaseClientSettings::setValue(const QString &key, const QVariant &v) { if (SettingValue::isUsableVariantType(valueType(key))) { d->m_valueHash.insert(key, SettingValue(v)); - if (key == binaryPathKey) - d->m_binaryFullPath = Utils::Environment::systemEnvironment().searchInPath(v.toString()); + d->m_binaryFullPath.clear(); } } @@ -346,6 +349,11 @@ QVariant::Type VcsBaseClientSettings::valueType(const QString &key) const QString VcsBaseClientSettings::binaryPath() const { + if (d->m_binaryFullPath.isEmpty()) { + d->m_binaryFullPath = Utils::Environment::systemEnvironment().searchInPath( + stringValue(binaryPathKey), stringValue(pathKey).split( + Utils::HostOsInfo::pathListSeparator())); + } return d->m_binaryFullPath; } diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.h b/src/plugins/vcsbase/vcsbaseclientsettings.h index f840a085c2..20ed803c54 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.h +++ b/src/plugins/vcsbase/vcsbaseclientsettings.h @@ -54,6 +54,7 @@ public: static const QLatin1String logCountKey; static const QLatin1String promptOnSubmitKey; static const QLatin1String timeoutKey; // Seconds + static const QLatin1String pathKey; VcsBaseClientSettings(); VcsBaseClientSettings(const VcsBaseClientSettings &other); diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index b11c734807..45a1fa1909 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -66,7 +66,6 @@ #include <QDebug> #include <QDir> -#include <QTemporaryFile> #include <QProcess> #include <QFile> #include <QFileInfo> |