Merge remote-tracking branch 'origin/2.6'

Conflicts:
	qtcreator.qbp
	src/plugins/qtsupport/baseqtversion.cpp
	src/tools/tools.pro

Change-Id: I43c391328ae747b3dc566f9db2384fedc1a6d0a5
This commit is contained in:
Eike Ziller
2012-09-26 10:01:04 +02:00
145 changed files with 4530 additions and 534 deletions

6
README
View File

@@ -10,12 +10,12 @@ Windows 7, Windows XP SP2, Windows Vista
(K)Ubuntu Linux 8.04 (32-bit and 64-bit) or later (K)Ubuntu Linux 8.04 (32-bit and 64-bit) or later
Mac OS 10.5 or later Mac OS 10.5 or later
Building the sources requires Qt 4.7.4 or later. Building the sources requires Qt 4.8.0 or later.
Compiling Qt Creator Compiling Qt Creator
==================== ====================
Prerequisites: Prerequisites:
* Qt 4.7.4 * Qt 4.8.0
* On Windows: * On Windows:
- ActiveState Active Perl - ActiveState Active Perl
- MinGW 4.4 or later, Visual Studio 2008 or later - MinGW 4.4 or later, Visual Studio 2008 or later
@@ -36,7 +36,7 @@ Compiling Qt Quick Designer
--------------------------- ---------------------------
Qt Quick Designer (QmlDesigner plugin) depends on "private" headers from Qt Qt Quick Designer (QmlDesigner plugin) depends on "private" headers from Qt
4.7.4, specifically from the QtDeclarative module. These private headers always 4.8.0, specifically from the QtDeclarative module. These private headers always
end with an "_p.h". Nokia does not promise to keep these files or APIs binary end with an "_p.h". Nokia does not promise to keep these files or APIs binary
or source compatible between releases. This means that when compiled, the or source compatible between releases. This means that when compiled, the
plugin has a dependency to the exact Qt version it was compiled with. Running plugin has a dependency to the exact Qt version it was compiled with. Running

View File

@@ -9,7 +9,7 @@ QMAKE_STRIP =
QMAKE_CLEAN = qtcreator.sh QMAKE_CLEAN = qtcreator.sh
target.path = /bin target.path = $$QTC_PREFIX/bin
INSTALLS += target INSTALLS += target
OTHER_FILES = $$PWD/qtcreator.sh OTHER_FILES = $$PWD/qtcreator.sh

View File

@@ -435,7 +435,7 @@
\o Use \c{class} instead of \c{struct}. Some compilers mangle that \o Use \c{class} instead of \c{struct}. Some compilers mangle that
difference into the symbol names and spit out warnings if a struct difference into the symbol names and spit out warnings if a struct
declaration is followed by a class definition. To avoid ongoing declaration is followed by a class definition. To avoid ongoing
changes from one to the other we declare \c{class} the prefered way. changes from one to the other we declare \c{class} the preferred way.
\endlist \endlist
@@ -782,7 +782,7 @@
reentrant, though. reentrant, though.
\o A \c char is signed or unsigned dependent on the architecture. Use signed \o A \c char is signed or unsigned dependent on the architecture. Use signed
\c char or \c uchar if you explicitely want a signed or unsigned char. \c char or \c uchar if you explicitly want a signed or unsigned char.
The following code will break on PowerPC, for example: The following code will break on PowerPC, for example:
\code \code
@@ -848,7 +848,7 @@
\o No float comparisons (\c{-Wfloat-equal}). Use \c qFuzzyCompare to compare \o No float comparisons (\c{-Wfloat-equal}). Use \c qFuzzyCompare to compare
values with a delta. Use \c qIsNull to check whether a float is values with a delta. Use \c qIsNull to check whether a float is
binary 0, instead of comparing it to 0.0, or, prefered, move binary 0, instead of comparing it to 0.0, or, preferred, move
such code into an implementation file. such code into an implementation file.
\o Do not hide virtual methods in subclasses (\{-Woverloaded-virtual}). \o Do not hide virtual methods in subclasses (\{-Woverloaded-virtual}).

View File

@@ -78,12 +78,12 @@ dev_qch_docs.depends += dev_html_docs
!macx { !macx {
inst_qch_docs.files = $$QCH_FILE inst_qch_docs.files = $$QCH_FILE
inst_qch_docs.path = /share/doc/qtcreator inst_qch_docs.path = $$QTC_PREFIX/share/doc/qtcreator
inst_qch_docs.CONFIG += no_check_exist no_default_install inst_qch_docs.CONFIG += no_check_exist no_default_install
INSTALLS += inst_qch_docs INSTALLS += inst_qch_docs
inst_dev_qch_docs.files = $$DEV_QCH_FILE inst_dev_qch_docs.files = $$DEV_QCH_FILE
inst_dev_qch_docs.path = /share/doc/qtcreator inst_dev_qch_docs.path = $$QTC_PREFIX/share/doc/qtcreator
inst_dev_qch_docs.CONFIG += no_check_exist no_default_install inst_dev_qch_docs.CONFIG += no_check_exist no_default_install
INSTALLS += inst_dev_qch_docs INSTALLS += inst_dev_qch_docs

View File

@@ -102,7 +102,7 @@
\section2 Supported CDB Versions \section2 Supported CDB Versions
The CDB native debugger has similar funtionality to the non-Python GDB The CDB native debugger has similar functionality to the non-Python GDB
debugger engine. Specifically, it also uses compiled C++ code for the debugger engine. Specifically, it also uses compiled C++ code for the
debugging helper library. debugging helper library.

View File

@@ -193,7 +193,7 @@
While this mode does not strictly require a project to be opened in \QC, While this mode does not strictly require a project to be opened in \QC,
it is beneficial to have open one, as it makes setting breakpoints it is beneficial to have open one, as it makes setting breakpoints
and stepping throught the code easier. and stepping through the code easier.
You can specify breakpoints before or after attaching the You can specify breakpoints before or after attaching the
debugger to the application. debugger to the application.

View File

@@ -1652,7 +1652,7 @@
\row \row
\o Switch with Next/Previous Parameter \o Switch with Next/Previous Parameter
\o Moves a parameter down or up one position in a parameter list. \o Moves a parameter down or up one position in a parameter list.
\o Parameter in the declaration or definition of a fuction or method \o Parameter in the declaration or definition of a function or method
\row \row
\o Extract Method \o Extract Method
\o Moves the selected code to a new method and replaces the block of \o Moves the selected code to a new method and replaces the block of

View File

@@ -421,10 +421,10 @@
\o Find previous \o Find previous
\o Shift+F3 \o Shift+F3
\row \row
\o Find next occurence of selected text \o Find next occurrence of selected text
\o Ctrl+F3 \o Ctrl+F3
\row \row
\o Find previous occurence of selected text \o Find previous occurrence of selected text
\o Ctrl+Shift+F3 \o Ctrl+Shift+F3
\row \row
\o Replace next \o Replace next

View File

@@ -391,7 +391,7 @@
\o Return to original size \o Return to original size
\o Play and pause movies \o Play and pause animated GIF and MNG images
\endlist \endlist

View File

@@ -245,7 +245,7 @@
\section3 Reverting Changes Using Git \section3 Reverting Changes Using Git
The Git version control system has an index that is used to stage The Git version control system has an index that is used to stage
changes. The index is commited on the next commit. Git allows you to revert changes. The index is committed on the next commit. Git allows you to revert
back to the state of the last commit as well as to the state staged in the back to the state of the last commit as well as to the state staged in the
index. index.

View File

@@ -197,7 +197,7 @@
sudo apt-get install libgl-dev libglu-dev sudo apt-get install libgl-dev libglu-dev
\endcode \endcode
\section1 Platform Releated Questions \section1 Platform Related Questions
\bold {Where is application output shown in \QC?} \bold {Where is application output shown in \QC?}

View File

@@ -509,7 +509,7 @@
\endcode \endcode
By default, the scripts are run in the directory corresponding to By default, the scripts are run in the directory corresponding to
\c %TargetPath%. This can be overriden by specifying the attribute \c %TargetPath%. This can be overridden by specifying the attribute
\c workingdirectory on the element \c generatorscript. For example, if the \c workingdirectory on the element \c generatorscript. For example, if the
script creates the project directory by itself, %Path% can be specified. In script creates the project directory by itself, %Path% can be specified. In
that case, \c --dry-run should output the correct relative paths or absolute that case, \c --dry-run should output the correct relative paths or absolute

View File

@@ -53,7 +53,7 @@ Column {
* [bool=true] Specifies the grouping behavior. If enabled, the checked property on buttons contained * [bool=true] Specifies the grouping behavior. If enabled, the checked property on buttons contained
* in the group will be exclusive. * in the group will be exclusive.
* *
* Note that a button in an exclusive group will allways be checkable * Note that a button in an exclusive group will always be checkable
*/ */
property bool exclusive: true property bool exclusive: true

View File

@@ -53,7 +53,7 @@ Row {
* [bool=true] Specifies the grouping behavior. If enabled, the checked property on buttons contained * [bool=true] Specifies the grouping behavior. If enabled, the checked property on buttons contained
* in the group will be exclusive. * in the group will be exclusive.
* *
* Note that a button in an exclusive group will allways be checkable * Note that a button in an exclusive group will always be checkable
*/ */
property bool exclusive: true property bool exclusive: true

View File

@@ -37,7 +37,7 @@ MouseArea {
// need to reparent it to the root item to fake it upon showing the popup. // need to reparent it to the root item to fake it upon showing the popup.
// In that case, the popup will also fill the whole window to allow the user to // In that case, the popup will also fill the whole window to allow the user to
// close the popup by clicking anywhere in the window. Letting the popup act as the mouse // close the popup by clicking anywhere in the window. Letting the popup act as the mouse
// area for the button that 'owns' it is also nessesary to support drag'n'release behavior. // area for the button that 'owns' it is also necessary to support drag'n'release behavior.
// The 'popupframe' delegate will be told to show or hide by assigning // The 'popupframe' delegate will be told to show or hide by assigning
// opacity to 1 or 0, respectively. // opacity to 1 or 0, respectively.

View File

@@ -52,6 +52,6 @@ DATA_FILE_PATTERNS = \
!macx { !macx {
qmlfiles.files = $$PWD/*.qml $$PWD/qmldir $$PWD/images $$PWD/custom qmlfiles.files = $$PWD/*.qml $$PWD/qmldir $$PWD/images $$PWD/custom
qmlfiles.path = /$${IDE_LIBRARY_BASENAME}/qtcreator/qtcomponents qmlfiles.path = $$QTC_PREFIX/$${IDE_LIBRARY_BASENAME}/qtcreator/qtcomponents
INSTALLS += qmlfiles INSTALLS += qmlfiles
} }

View File

@@ -3,6 +3,10 @@ QTCREATOR_PRI_INCLUDED = 1
QTCREATOR_VERSION = 2.6.81 QTCREATOR_VERSION = 2.6.81
isEmpty(QTC_PREFIX) {
unix:!macx: QTC_PREFIX = /usr/local
}
isEqual(QT_MAJOR_VERSION, 5) { isEqual(QT_MAJOR_VERSION, 5) {
defineReplace(cleanPath) { defineReplace(cleanPath) {

View File

@@ -26,19 +26,23 @@ macx {
dmg.depends = deployqt dmg.depends = deployqt
QMAKE_EXTRA_TARGETS += codesign dmg QMAKE_EXTRA_TARGETS += codesign dmg
} else { } else {
deployqt.commands = $$PWD/scripts/deployqt.py -i $(INSTALL_ROOT) deployqt.commands = $$PWD/scripts/deployqt.py -i \"$(INSTALL_ROOT)$$QTC_PREFIX\"
deployqt.depends = install deployqt.depends = install
win32 { win32 {
bindist.commands ~= s,/,\\\\,g bindist.commands ~= s,/,\\\\,g
deployqt.commands ~= s,/,\\\\,g deployqt.commands ~= s,/,\\\\,g
deployartifacts.depends = install deployartifacts.depends = install
PLATFORM="windows" PLATFORM="windows"
deployartifacts.commands = git clone "git://gitorious.org/qt-creator/binary-artifacts.git"&& xcopy /s /q /y /i "binary-artifacts\\win32" $(INSTALL_ROOT)&& rmdir /s /q binary-artifacts deployartifacts.commands = git clone "git://gitorious.org/qt-creator/binary-artifacts.git"&& xcopy /s /q /y /i "binary-artifacts\\win32" \"$(INSTALL_ROOT)$$QTC_PREFIX\"&& rmdir /s /q binary-artifacts
QMAKE_EXTRA_TARGETS += deployartifacts QMAKE_EXTRA_TARGETS += deployartifacts
} }
else:linux-*: PLATFORM = "linux-$${QT_ARCH}" else:linux-*: PLATFORM = "linux-$${QT_ARCH}"
else:PLATFORM = "unknown" else:PLATFORM = "unknown"
bindist.commands = $$PWD/scripts/bindistHelper.py "$(INSTALL_ROOT)" "$${PLATFORM}$(INSTALL_EDITION)-$${QTCREATOR_VERSION}$(INSTALL_POSTFIX)" PATTERN = $${PLATFORM}$(INSTALL_EDITION)-$${QTCREATOR_VERSION}$(INSTALL_POSTFIX)
bindist.commands = 7z a -mx9 qt-creator-$${PATTERN}.7z \"$(INSTALL_ROOT)$$QTC_PREFIX\"
win32 {
bindist.commands ~= s,/,\\\\,g
}
} }
bindist.depends = deployqt
QMAKE_EXTRA_TARGETS += deployqt bindist QMAKE_EXTRA_TARGETS += deployqt bindist

View File

@@ -12,6 +12,7 @@ Project {
references: [ references: [
"lib/qtcreator/qtcomponents/qtcomponents.qbs", "lib/qtcreator/qtcomponents/qtcomponents.qbs",
"share/share.qbs", "share/share.qbs",
"share/qtcreator/translations/translations.qbs",
"src/libs/3rdparty/botan/botan.qbs", "src/libs/3rdparty/botan/botan.qbs",
"src/libs/aggregation/aggregation.qbs", "src/libs/aggregation/aggregation.qbs",
"src/libs/cplusplus/cplusplus.qbs", "src/libs/cplusplus/cplusplus.qbs",
@@ -79,7 +80,8 @@ Project {
"src/tools/qtcdebugger/qtcdebugger.qbs", "src/tools/qtcdebugger/qtcdebugger.qbs",
"src/tools/qtcreatorcrashhandler/qtcreatorcrashhandler.qbs", "src/tools/qtcreatorcrashhandler/qtcreatorcrashhandler.qbs",
"src/tools/qtpromaker/qtpromaker.qbs", "src/tools/qtpromaker/qtpromaker.qbs",
"src/plugins/cpaster/frontend/frontend.qbs" "src/plugins/cpaster/frontend/frontend.qbs",
"src/tools/sdktool/sdktool.qbs"
] ]
Product { Product {

View File

@@ -1,87 +0,0 @@
#!/usr/bin/env python
################################################################################
# Copyright (c) 2011 Nokia Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Nokia Corporation, nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
################################################################################
import os
import sys
import getopt
import subprocess
import tempfile
import re
import shutil
def usage():
print "Usage: %s <creator_install_dir> <pattern>" % os.path.basename(sys.argv[0])
def main():
try:
opts, args = getopt.gnu_getopt(sys.argv[1:], 'h', ['help'])
except:
usage()
sys.exit(2)
for o, a in opts:
if o in ('-h', '--help'):
usage()
sys.exit(0)
if len(args) < 2:
usage()
sys.exit(2)
sourcedir=args[0]
pattern=args[1]
try:
temp_dir = tempfile.mkdtemp()
except:
print "Failed to create a temporary directory!"
sys.exit(2)
try:
formatted_dirname = "qt-creator-%s" % pattern
temp_fullpath = os.path.join(temp_dir, formatted_dirname)
print "Copying files to temporary directory '%s' for packaging..." % temp_fullpath
shutil.copytree(sourcedir, temp_fullpath, symlinks=True)
print "7-zipping temporary directory..."
output = subprocess.check_output(['7z', 'a', '-mx9', formatted_dirname+'.7z', temp_fullpath])
print output
except:
print "Error occured, cleaning up..."
shutil.rmtree(temp_dir)
sys.exit(2)
print "Cleaning up..."
shutil.rmtree(temp_dir)
print "Done."
if __name__ == "__main__":
if sys.platform == 'darwin':
print "Mac OS does not require this script!"
sys.exit(2)
else:
main()

View File

@@ -1695,7 +1695,7 @@ static void qDumpQImage(QDumper &d)
static void qDumpQImageData(QDumper &d) static void qDumpQImageData(QDumper &d)
{ {
const QImage &im = *reinterpret_cast<const QImage *>(d.data); const QImage &im = *reinterpret_cast<const QImage *>(d.data);
const QByteArray ba(QByteArray::fromRawData((const char*)im.bits(), im.numBytes())); const QByteArray ba(QByteArray::fromRawData((const char*)im.bits(), im.byteCount()));
d.putItem("type", NS "QImageData"); d.putItem("type", NS "QImageData");
d.putItem("numchild", "0"); d.putItem("numchild", "0");
#if 1 #if 1

View File

@@ -34,6 +34,6 @@ macx {
info.output = $$DESTDIR/$${TARGET}.app/Contents/Info.plist info.output = $$DESTDIR/$${TARGET}.app/Contents/Info.plist
QMAKE_SUBSTITUTES += info QMAKE_SUBSTITUTES += info
} else { } else {
target.path = /bin target.path = $$QTC_PREFIX/bin
INSTALLS += target INSTALLS += target
} }

View File

@@ -20,6 +20,6 @@ macx {
info.output = $$DESTDIR/$${TARGET}.app/Contents/Info.plist info.output = $$DESTDIR/$${TARGET}.app/Contents/Info.plist
QMAKE_SUBSTITUTES += info QMAKE_SUBSTITUTES += info
} else { } else {
target.path = /bin target.path = $$QTC_PREFIX/bin
INSTALLS += target INSTALLS += target
} }

View File

@@ -63,7 +63,7 @@ OTHER_FILES += $$FILES
!macx { !macx {
for(data_dir, DATA_DIRS) { for(data_dir, DATA_DIRS) {
eval($${data_dir}.files = $$quote($$PWD/$$data_dir)) eval($${data_dir}.files = $$quote($$PWD/$$data_dir))
eval($${data_dir}.path = /share/qtcreator) eval($${data_dir}.path = $$QTC_PREFIX/share/qtcreator)
INSTALLS += $$data_dir INSTALLS += $$data_dir
} }
} else { } else {
@@ -116,7 +116,7 @@ QMAKE_EXTRA_COMPILERS += unconditionalCopy2build
!macx { !macx {
for(data_dir, DATA_DIRS) { for(data_dir, DATA_DIRS) {
eval($${data_dir}.files = $$IDE_DATA_PATH/$$data_dir) eval($${data_dir}.files = $$IDE_DATA_PATH/$$data_dir)
eval($${data_dir}.path = /share/qtcreator) eval($${data_dir}.path = $$QTC_PREFIX/share/qtcreator)
eval($${data_dir}.CONFIG += no_check_exist) eval($${data_dir}.CONFIG += no_check_exist)
INSTALLS += $$data_dir INSTALLS += $$data_dir
} }

View File

@@ -120,6 +120,6 @@ isEmpty(vcproj) {
} }
qmfiles.files = $$prependAll(LANGUAGES, $$OUT_PWD/qtcreator_,.qm) qmfiles.files = $$prependAll(LANGUAGES, $$OUT_PWD/qtcreator_,.qm)
qmfiles.path = /share/qtcreator/translations qmfiles.path = $$QTC_PREFIX/share/qtcreator/translations
qmfiles.CONFIG += no_check_exist qmfiles.CONFIG += no_check_exist
INSTALLS += qmfiles INSTALLS += qmfiles

View File

@@ -0,0 +1,9 @@
import qbs.base 1.0
Product {
type: "qm"
name: "translations"
Depends { name: "Qt.core" }
destination: "share/qtcreator/translations"
files: "*.ts"
}

View File

@@ -104,7 +104,7 @@ Rectangle {
imageUrl: "widgets/images/gettingStarted01.png" imageUrl: "widgets/images/gettingStarted01.png"
title: qsTr("IDE Overview") title: qsTr("IDE Overview")
description: qsTr("To find out what kind of integrated enviroment (IDE) Qt Creator is.") description: qsTr("To find out what kind of integrated environment (IDE) Qt Creator is.")
number: 1 number: 1
onClicked: gettingStarted.openHelp("qthelp://com.nokia.qtcreator/doc/creator-overview.html") onClicked: gettingStarted.openHelp("qthelp://com.nokia.qtcreator/doc/creator-overview.html")
@@ -114,7 +114,7 @@ Rectangle {
x: 250 x: 250
y: 83 y: 83
description: qsTr("To become familar with the parts of the Qt Creator user interface and to learn how to use them.") description: qsTr("To become familiar with the parts of the Qt Creator user interface and to learn how to use them.")
title: qsTr("User Interface") title: qsTr("User Interface")
imageUrl: "widgets/images/gettingStarted02.png" imageUrl: "widgets/images/gettingStarted02.png"
number: 2 number: 2

View File

@@ -18,7 +18,7 @@ QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
} }
win32 { win32 {
RC_FILE = qtcreator.rc RC_FILE = qtcreator.rc
target.path = /bin target.path = $$QTC_PREFIX/bin
INSTALLS += target INSTALLS += target
} else:macx { } else:macx {
LIBS += -framework CoreFoundation LIBS += -framework CoreFoundation
@@ -30,7 +30,7 @@ win32 {
info.output = $$IDE_BIN_PATH/../Info.plist info.output = $$IDE_BIN_PATH/../Info.plist
QMAKE_SUBSTITUTES = info QMAKE_SUBSTITUTES = info
} else { } else {
target.path = /bin target.path = $$QTC_PREFIX/bin
INSTALLS += target INSTALLS += target
} }

View File

@@ -49,6 +49,7 @@
#include <QList> #include <QList>
#include <QDebug> #include <QDebug>
#include <QSet> #include <QSet>
#include <map>
using namespace CPlusPlus; using namespace CPlusPlus;
@@ -630,7 +631,8 @@ bool ResolveExpression::visit(CallAST *ast)
} }
if (_reference) { if (_reference) {
_results.clear(); typedef std::multimap<int, LookupItem> LookupMap;
LookupMap sortedResults;
foreach (const LookupItem &base, baseResults) { foreach (const LookupItem &base, baseResults) {
if (Function *funTy = base.type()->asFunctionType()) { if (Function *funTy = base.type()->asFunctionType()) {
if (! maybeValidPrototype(funTy, actualArgumentCount)) if (! maybeValidPrototype(funTy, actualArgumentCount))
@@ -655,13 +657,13 @@ bool ResolveExpression::visit(CallAST *ast)
++score; ++score;
} }
if (score) sortedResults.insert(LookupMap::value_type(-score, base));
_results.prepend(base);
else
_results.append(base);
} }
} }
_results.clear();
for (LookupMap::const_iterator it = sortedResults.begin(); it != sortedResults.end(); ++it)
_results.append(it->second);
if (_results.isEmpty()) if (_results.isEmpty())
_results = baseResults; _results = baseResults;

View File

@@ -33,6 +33,6 @@ SOURCES += qtmenu.cpp \
qwheelarea.cpp qwheelarea.cpp
!macx { !macx {
target.path = /$${IDE_LIBRARY_BASENAME}/qtcreator/qtcomponents/plugin target.path = $$QTC_PREFIX/$${IDE_LIBRARY_BASENAME}/qtcreator/qtcomponents/plugin
INSTALLS += target INSTALLS += target
} }

View File

@@ -82,6 +82,6 @@ HEADERS += extensioncontext.h \
knowntype.h \ knowntype.h \
symbolgroupnode.h symbolgroupnode.h
target.path = /lib/$${DIRNAME} target.path = $$QTC_PREFIX/lib/$${DIRNAME}
INSTALLS += target INSTALLS += target

View File

@@ -109,7 +109,9 @@ QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath, bool
static QRegExp regexp(QLatin1String("(QMake version|QMake version:)[\\s]*([\\d.]*)"), static QRegExp regexp(QLatin1String("(QMake version|QMake version:)[\\s]*([\\d.]*)"),
Qt::CaseInsensitive); Qt::CaseInsensitive);
regexp.indexIn(output); regexp.indexIn(output);
if (regexp.cap(2).startsWith(QLatin1String("2."))) { const QString qmakeVersion = regexp.cap(2);
if (qmakeVersion.startsWith(QLatin1String("2."))
|| qmakeVersion.startsWith(QLatin1String("3."))) {
static QRegExp regexp2(QLatin1String("Using Qt version[\\s]*([\\d\\.]*)"), static QRegExp regexp2(QLatin1String("Using Qt version[\\s]*([\\d\\.]*)"),
Qt::CaseInsensitive); Qt::CaseInsensitive);
regexp2.indexIn(output); regexp2.indexIn(output);

View File

@@ -374,11 +374,24 @@ PersistentSettingsWriter::PersistentSettingsWriter(const FileName &fileName, con
m_fileName(fileName), m_docType(docType) m_fileName(fileName), m_docType(docType)
{ } { }
PersistentSettingsWriter::~PersistentSettingsWriter()
{
write(m_savedData, 0);
}
bool PersistentSettingsWriter::save(const QVariantMap &data, QWidget *parent) const bool PersistentSettingsWriter::save(const QVariantMap &data, QWidget *parent) const
{ {
if (data == m_savedData) if (data == m_savedData)
return true; return true;
return write(data, parent);
}
FileName PersistentSettingsWriter::fileName() const
{ return m_fileName; }
bool PersistentSettingsWriter::write(const QVariantMap &data, QWidget *parent) const
{
QDir tmp; QDir tmp;
tmp.mkpath(m_fileName.toFileInfo().path()); tmp.mkpath(m_fileName.toFileInfo().path());
Utils::FileSaver saver(m_fileName.toString(), QIODevice::Text); Utils::FileSaver saver(m_fileName.toString(), QIODevice::Text);
@@ -411,7 +424,4 @@ bool PersistentSettingsWriter::save(const QVariantMap &data, QWidget *parent) co
return ok; return ok;
} }
FileName PersistentSettingsWriter::fileName() const
{ return m_fileName; }
} // namespace Utils } // namespace Utils

View File

@@ -60,11 +60,15 @@ class QTCREATOR_UTILS_EXPORT PersistentSettingsWriter
{ {
public: public:
PersistentSettingsWriter(const FileName &fileName, const QString &docType); PersistentSettingsWriter(const FileName &fileName, const QString &docType);
~PersistentSettingsWriter();
bool save(const QVariantMap &data, QWidget *parent) const; bool save(const QVariantMap &data, QWidget *parent) const;
Utils::FileName fileName() const; Utils::FileName fileName() const;
private: private:
bool write(const QVariantMap &data, QWidget *parent) const;
const Utils::FileName m_fileName; const Utils::FileName m_fileName;
const QString m_docType; const QString m_docType;
mutable QMap<QString, QVariant> m_savedData; mutable QMap<QString, QVariant> m_savedData;

View File

@@ -17,5 +17,5 @@ build_all:!build_pass {
CONFIG += release CONFIG += release
} }
target.path = /bin # FIXME: libexec, more or less target.path = $$QTC_PREFIX/bin # FIXME: libexec, more or less
INSTALLS += target INSTALLS += target

View File

@@ -20,5 +20,5 @@ unix {
LIBS += -lshell32 LIBS += -lshell32
} }
target.path = /bin # FIXME: libexec, more or less target.path = $$QTC_PREFIX/bin # FIXME: libexec, more or less
INSTALLS += target INSTALLS += target

View File

@@ -213,7 +213,9 @@ QtcLibrary {
} }
ProductModule { ProductModule {
Depends { name: "cpp" }
Depends { name: "Qt"; submodules: ["concurrent", "widgets" ] } Depends { name: "Qt"; submodules: ["concurrent", "widgets" ] }
cpp.includePaths: [".."]
} }
} }

View File

@@ -344,7 +344,7 @@ QModelIndex BookmarkManager::index(int row, int column, const QModelIndex &paren
if (parent.isValid()) if (parent.isValid())
return QModelIndex(); return QModelIndex();
else else
return createIndex(row, column, 0); return createIndex(row, column);
} }
QModelIndex BookmarkManager::parent(const QModelIndex &) const QModelIndex BookmarkManager::parent(const QModelIndex &) const

View File

@@ -49,6 +49,8 @@ ActivitySelector::ActivitySelector(QWidget *parent) :
m_plugin(ClearCasePlugin::instance()), m_plugin(ClearCasePlugin::instance()),
m_changed(false) m_changed(false)
{ {
QTC_ASSERT(m_plugin->isUcm(), return);
QHBoxLayout *hboxLayout = new QHBoxLayout(this); QHBoxLayout *hboxLayout = new QHBoxLayout(this);
hboxLayout->setContentsMargins(0, 0, 0, 0); hboxLayout->setContentsMargins(0, 0, 0, 0);

View File

@@ -31,8 +31,8 @@
**************************************************************************/ **************************************************************************/
#include "checkoutdialog.h" #include "checkoutdialog.h"
#include "clearcaseplugin.h"
#include "ui_checkoutdialog.h" #include "ui_checkoutdialog.h"
#include "activityselector.h"
#include <QList> #include <QList>
#include <QPair> #include <QPair>
@@ -41,11 +41,23 @@
namespace ClearCase { namespace ClearCase {
namespace Internal { namespace Internal {
CheckOutDialog::CheckOutDialog(const QString &fileName, QWidget *parent) : CheckOutDialog::CheckOutDialog(const QString &fileName, bool isUcm, QWidget *parent) :
QDialog(parent), ui(new Ui::CheckOutDialog) QDialog(parent), ui(new Ui::CheckOutDialog), m_actSelector(0)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->lblFileName->setText(fileName); ui->lblFileName->setText(fileName);
if (isUcm) {
m_actSelector = new ActivitySelector(this);
ui->verticalLayout->insertWidget(0, m_actSelector);
QFrame *line = new QFrame(this);
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
ui->verticalLayout->insertWidget(1, line);
}
} }
CheckOutDialog::~CheckOutDialog() CheckOutDialog::~CheckOutDialog()
@@ -55,7 +67,7 @@ CheckOutDialog::~CheckOutDialog()
QString CheckOutDialog::activity() const QString CheckOutDialog::activity() const
{ {
return ui->actSelector->activity(); return m_actSelector ? m_actSelector->activity() : QString();
} }
QString CheckOutDialog::comment() const QString CheckOutDialog::comment() const

View File

@@ -42,12 +42,14 @@ namespace Ui {
class CheckOutDialog; class CheckOutDialog;
} }
class ActivitySelector;
class CheckOutDialog : public QDialog class CheckOutDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit CheckOutDialog(const QString &fileName, QWidget *parent = 0); explicit CheckOutDialog(const QString &fileName, bool isUcm, QWidget *parent = 0);
~CheckOutDialog(); ~CheckOutDialog();
QString activity() const; QString activity() const;
QString comment() const; QString comment() const;
@@ -62,6 +64,7 @@ private slots:
private: private:
Ui::CheckOutDialog *ui; Ui::CheckOutDialog *ui;
ActivitySelector *m_actSelector;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -21,16 +21,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="ActivitySelector" name="actSelector" native="true"/>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="lblComment"> <widget class="QLabel" name="lblComment">
<property name="text"> <property name="text">
@@ -110,14 +100,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>ActivitySelector</class>
<extends>QWidget</extends>
<header>activityselector.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections> <connections>
<connection> <connection>

View File

@@ -85,18 +85,20 @@
#include <QMenu> #include <QMenu>
#include <QMessageBox> #include <QMessageBox>
#include <QMutex> #include <QMutex>
#include <QProcess>
#include <QRegExp>
#include <QSharedPointer>
#include <QtConcurrentRun>
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QTextCodec> #include <QTextCodec>
#include <QProcess>
#include <QSharedPointer>
#include <QTimer> #include <QTimer>
#include <QtPlugin>
#include <QUrl> #include <QUrl>
#include <QUuid> #include <QUuid>
#include <QVariant> #include <QVariant>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QtConcurrentRun>
#include <QtPlugin>
namespace ClearCase { namespace ClearCase {
namespace Internal { namespace Internal {
@@ -161,6 +163,8 @@ ClearCasePlugin *ClearCasePlugin::m_clearcasePluginInstance = 0;
ClearCasePlugin::ClearCasePlugin() : ClearCasePlugin::ClearCasePlugin() :
VcsBase::VcsBasePlugin(QLatin1String(ClearCase::Constants::CLEARCASECHECKINEDITOR_ID)), VcsBase::VcsBasePlugin(QLatin1String(ClearCase::Constants::CLEARCASECHECKINEDITOR_ID)),
m_isDynamic(false),
m_isUcm(false),
m_commandLocator(0), m_commandLocator(0),
m_checkOutAction(0), m_checkOutAction(0),
m_checkInCurrentAction(0), m_checkInCurrentAction(0),
@@ -211,6 +215,14 @@ bool ClearCasePlugin::isCheckInEditorOpen() const
return !m_checkInMessageFileName.isEmpty(); return !m_checkInMessageFileName.isEmpty();
} }
/*! Find top level for view that contains \a directory
*
* - Snapshot Views will have the CLEARCASE_ROOT_FILE (view.dat) in its top dir
* - Dynamic views can either be
* - M:/view_name,
* - or mapped to a drive letter, like Z:/
* (drive letters are just examples)
*/
QString ClearCasePlugin::findTopLevel(const QString &directory) const QString ClearCasePlugin::findTopLevel(const QString &directory) const
{ {
// Snapshot view // Snapshot view
@@ -218,6 +230,7 @@ QString ClearCasePlugin::findTopLevel(const QString &directory) const
findRepositoryForDirectory(directory, QLatin1String(ClearCase::Constants::CLEARCASE_ROOT_FILE)); findRepositoryForDirectory(directory, QLatin1String(ClearCase::Constants::CLEARCASE_ROOT_FILE));
if (!topLevel.isEmpty() || !clearCaseControl()->isConfigured()) if (!topLevel.isEmpty() || !clearCaseControl()->isConfigured())
return topLevel; return topLevel;
// Dynamic view // Dynamic view
if (directory.startsWith(m_topLevel) && directory.at(m_topLevel.size()) == QLatin1Char('/')) if (directory.startsWith(m_topLevel) && directory.at(m_topLevel.size()) == QLatin1Char('/'))
return m_topLevel; return m_topLevel;
@@ -554,7 +567,7 @@ QString ClearCasePlugin::ccGetFileActivity(const QString &workingDir, const QStr
return response.stdOut; return response.stdOut;
} }
ClearCaseSubmitEditor *ClearCasePlugin::openClearCaseSubmitEditor(const QString &fileName) ClearCaseSubmitEditor *ClearCasePlugin::openClearCaseSubmitEditor(const QString &fileName, bool isUcm)
{ {
Core::IEditor *editor = Core::IEditor *editor =
Core::EditorManager::openEditor(fileName, Core::EditorManager::openEditor(fileName,
@@ -565,18 +578,28 @@ ClearCaseSubmitEditor *ClearCasePlugin::openClearCaseSubmitEditor(const QString
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_checkInSelectedAction, m_checkInDiffAction); submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_checkInSelectedAction, m_checkInDiffAction);
connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(diffCheckInFiles(QStringList))); connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(diffCheckInFiles(QStringList)));
submitEditor->setCheckScriptWorkingDirectory(m_checkInView); submitEditor->setCheckScriptWorkingDirectory(m_checkInView);
submitEditor->setIsUcm(isUcm);
return submitEditor; return submitEditor;
} }
void ClearCasePlugin::updateStatusActions() void ClearCasePlugin::updateStatusActions()
{ {
bool hasFile = currentState().hasFile(); bool hasFile = currentState().hasFile();
FileStatus fileStatus = m_statusMap->value(currentState().relativeCurrentFile(), FileStatus(FileStatus::Unknown)); QString fileName = currentState().relativeCurrentFile();
FileStatus fileStatus = m_statusMap->value(fileName, FileStatus(FileStatus::Unknown));
if (ClearCase::Constants::debug)
qDebug() << Q_FUNC_INFO << fileName << ", status = " << fileStatus.status;
m_checkOutAction->setEnabled(hasFile && (fileStatus.status & (FileStatus::CheckedIn | FileStatus::Hijacked))); m_checkOutAction->setEnabled(hasFile && (fileStatus.status & (FileStatus::CheckedIn | FileStatus::Hijacked)));
m_undoCheckOutAction->setEnabled(hasFile && (fileStatus.status & FileStatus::CheckedOut)); m_undoCheckOutAction->setEnabled(hasFile && (fileStatus.status & FileStatus::CheckedOut));
m_undoHijackAction->setEnabled(hasFile && (fileStatus.status & FileStatus::Hijacked)); m_undoHijackAction->setEnabled(!m_isDynamic && hasFile && (fileStatus.status & FileStatus::Hijacked));
m_checkInCurrentAction->setEnabled(hasFile && (fileStatus.status & FileStatus::CheckedOut)); m_checkInCurrentAction->setEnabled(hasFile && (fileStatus.status & FileStatus::CheckedOut));
m_addFileAction->setEnabled(hasFile && (fileStatus.status & FileStatus::NotManaged)); m_addFileAction->setEnabled(hasFile && (fileStatus.status & FileStatus::NotManaged));
m_checkInActivityAction->setEnabled(m_isUcm);
m_diffActivityAction->setEnabled(m_isUcm);
} }
void ClearCasePlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) void ClearCasePlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
@@ -591,7 +614,7 @@ void ClearCasePlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
if (hasTopLevel) if (hasTopLevel)
m_topLevel = state.topLevel(); m_topLevel = state.topLevel();
m_updateViewAction->setParameter(m_view); m_updateViewAction->setParameter(m_isDynamic ? QString() : m_view);
const QString fileName = state.currentFileName(); const QString fileName = state.currentFileName();
m_checkOutAction->setParameter(fileName); m_checkOutAction->setParameter(fileName);
@@ -679,6 +702,12 @@ bool ClearCasePlugin::vcsUndoCheckOut(const QString &workingDir, const QString &
return !response.error; return !response.error;
} }
/*! Undo a hijacked file in a snapshot view
*
* Runs cleartool update -overwrite \a fileName in \a workingDir
* if \a keep is true, renames hijacked files to <filename>.keep. Otherwise it is overwritten
*/
bool ClearCasePlugin::vcsUndoHijack(const QString &workingDir, const QString &fileName, bool keep) bool ClearCasePlugin::vcsUndoHijack(const QString &workingDir, const QString &fileName, bool keep)
{ {
if (ClearCase::Constants::debug) if (ClearCase::Constants::debug)
@@ -913,8 +942,11 @@ void ClearCasePlugin::startCheckInAll()
void ClearCasePlugin::startCheckInActivity() void ClearCasePlugin::startCheckInActivity()
{ {
QTC_ASSERT(isUcm(), return);
const VcsBase::VcsBasePluginState state = currentState(); const VcsBase::VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return); QTC_ASSERT(state.hasProject(), return);
QDialog dlg; QDialog dlg;
QVBoxLayout *layout = new QVBoxLayout(&dlg); QVBoxLayout *layout = new QVBoxLayout(&dlg);
ActivitySelector *actSelector = new ActivitySelector(&dlg); ActivitySelector *actSelector = new ActivitySelector(&dlg);
@@ -926,6 +958,7 @@ void ClearCasePlugin::startCheckInActivity()
dlg.setWindowTitle(tr("Check In Activity")); dlg.setWindowTitle(tr("Check In Activity"));
if (!dlg.exec()) if (!dlg.exec())
return; return;
QString topLevel = state.topLevel(); QString topLevel = state.topLevel();
int topLevelLen = topLevel.length(); int topLevelLen = topLevel.length();
QStringList versions = ccGetActivityVersions(topLevel, actSelector->activity()); QStringList versions = ccGetActivityVersions(topLevel, actSelector->activity());
@@ -976,9 +1009,10 @@ void ClearCasePlugin::startCheckIn(const QString &workingDir, const QStringList
m_checkInMessageFileName = saver.fileName(); m_checkInMessageFileName = saver.fileName();
m_checkInView = workingDir; m_checkInView = workingDir;
// Create a submit editor and set file list // Create a submit editor and set file list
ClearCaseSubmitEditor *editor = openClearCaseSubmitEditor(m_checkInMessageFileName); ClearCaseSubmitEditor *editor = openClearCaseSubmitEditor(m_checkInMessageFileName, m_isUcm);
editor->setStatusList(files); editor->setStatusList(files);
if (files.size() == 1) {
if (m_isUcm && (files.size() == 1)) {
QString activity = ccGetFileActivity(workingDir, files.first()); QString activity = ccGetFileActivity(workingDir, files.first());
editor->submitEditorWidget()->setActivity(activity); editor->submitEditorWidget()->setActivity(activity);
} }
@@ -1038,6 +1072,8 @@ void ClearCasePlugin::history(const QString &workingDir,
void ClearCasePlugin::viewStatus() void ClearCasePlugin::viewStatus()
{ {
if (m_view.isEmpty())
m_view = ccGetView(m_topLevel);
QTC_ASSERT(!m_view.isEmpty() && !m_settings.disableIndexer, return); QTC_ASSERT(!m_view.isEmpty() && !m_settings.disableIndexer, return);
VcsBase::VcsBaseOutputWindow *outputwindow = VcsBase::VcsBaseOutputWindow::instance(); VcsBase::VcsBaseOutputWindow *outputwindow = VcsBase::VcsBaseOutputWindow::instance();
outputwindow->appendCommand(QLatin1String("Indexed files status (C=Checked Out, H=Hijacked, ?=Missing)")); outputwindow->appendCommand(QLatin1String("Indexed files status (C=Checked Out, H=Hijacked, ?=Missing)"));
@@ -1282,7 +1318,8 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
const QString file = QDir::toNativeSeparators(relFile); const QString file = QDir::toNativeSeparators(relFile);
const QString title = QString::fromLatin1("Checkout %1").arg(file); const QString title = QString::fromLatin1("Checkout %1").arg(file);
CheckOutDialog coDialog(title); CheckOutDialog coDialog(title, m_isUcm);
if (!m_settings.disableIndexer && if (!m_settings.disableIndexer &&
(fi.isWritable() || m_statusMap->value(relFile).status == FileStatus::Unknown)) (fi.isWritable() || m_statusMap->value(relFile).status == FileStatus::Unknown))
QtConcurrent::run(&sync, topLevel, QStringList(relFile)).waitForFinished(); QtConcurrent::run(&sync, topLevel, QStringList(relFile)).waitForFinished();
@@ -1290,12 +1327,14 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
QMessageBox::information(0, tr("ClearCase Checkout"), tr("File is already checked out.")); QMessageBox::information(0, tr("ClearCase Checkout"), tr("File is already checked out."));
return true; return true;
} }
bool isHijacked = (m_statusMap->value(relFile).status & FileStatus::Hijacked); // Only snapshot views can have hijacked files
bool isHijacked = (!m_isDynamic && (m_statusMap->value(relFile).status & FileStatus::Hijacked));
if (!isHijacked) if (!isHijacked)
coDialog.hideHijack(); coDialog.hideHijack();
if (coDialog.exec() == QDialog::Accepted) { if (coDialog.exec() == QDialog::Accepted) {
if (!vcsSetActivity(topLevel, title, coDialog.activity())) if (m_isUcm && !vcsSetActivity(topLevel, title, coDialog.activity()))
return false; return false;
Core::FileChangeBlocker fcb(absPath); Core::FileChangeBlocker fcb(absPath);
QStringList args(QLatin1String("checkout")); QStringList args(QLatin1String("checkout"));
QString comment = coDialog.comment(); QString comment = coDialog.comment();
@@ -1311,6 +1350,14 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
if (coDialog.isPreserveTime()) if (coDialog.isPreserveTime())
args << QLatin1String("-ptime"); args << QLatin1String("-ptime");
if (isHijacked) { if (isHijacked) {
if (ClearCase::Constants::debug)
qDebug() << Q_FUNC_INFO << file << " seems to be hijacked";
// A hijacked files means that the file is modified but was
// not checked out. By checking it out now changes will
// be lost, unless handled. This can be done by renaming
// the hijacked file, undoing the hijack and updating the file
// -usehijack not supported in old cleartool versions... // -usehijack not supported in old cleartool versions...
// args << QLatin1String("-usehijack"); // args << QLatin1String("-usehijack");
if (coDialog.isUseHijacked()) if (coDialog.isUseHijacked())
@@ -1420,7 +1467,7 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
const QString file = QDir::toNativeSeparators(fileName); const QString file = QDir::toNativeSeparators(fileName);
bool noCheckout = false; bool noCheckout = false;
QVBoxLayout *verticalLayout; QVBoxLayout *verticalLayout;
ActivitySelector *actSelector; ActivitySelector *actSelector = 0;
QLabel *commentLabel; QLabel *commentLabel;
QTextEdit *commentEdit; QTextEdit *commentEdit;
QDialogButtonBox *buttonBox; QDialogButtonBox *buttonBox;
@@ -1428,8 +1475,10 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
fileOpDlg.setWindowTitle(title); fileOpDlg.setWindowTitle(title);
verticalLayout = new QVBoxLayout(&fileOpDlg); verticalLayout = new QVBoxLayout(&fileOpDlg);
if (m_isUcm) {
actSelector = new ActivitySelector; actSelector = new ActivitySelector;
verticalLayout->addWidget(actSelector); verticalLayout->addWidget(actSelector);
}
commentLabel = new QLabel(tr("Enter &comment:")); commentLabel = new QLabel(tr("Enter &comment:"));
verticalLayout->addWidget(commentLabel); verticalLayout->addWidget(commentLabel);
@@ -1450,9 +1499,11 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
if (!fileOpDlg.exec()) if (!fileOpDlg.exec())
return true; return true;
QString comment = commentEdit->toPlainText(); QString comment = commentEdit->toPlainText();
if (actSelector->changed()) if (m_isUcm && actSelector->changed())
vcsSetActivity(workingDir, fileOpDlg.windowTitle(), actSelector->activity()); vcsSetActivity(workingDir, fileOpDlg.windowTitle(), actSelector->activity());
QString dirName = QDir::toNativeSeparators(QFileInfo(workingDir, fileName).absolutePath()); QString dirName = QDir::toNativeSeparators(QFileInfo(workingDir, fileName).absolutePath());
QStringList commentArg; QStringList commentArg;
if (comment.isEmpty()) if (comment.isEmpty())
@@ -1500,26 +1551,32 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
return true; return true;
} }
static QString baseName(const QString &fileName)
{
return fileName.mid(fileName.lastIndexOf(QLatin1Char('/')) + 1);
}
bool ClearCasePlugin::vcsAdd(const QString &workingDir, const QString &fileName) bool ClearCasePlugin::vcsAdd(const QString &workingDir, const QString &fileName)
{ {
return ccFileOp(workingDir, tr("ClearCase Add File"), return ccFileOp(workingDir, tr("ClearCase Add File %1").arg(baseName(fileName)),
QStringList() << QLatin1String("mkelem") << QLatin1String("-ci"), fileName); QStringList() << QLatin1String("mkelem") << QLatin1String("-ci"), fileName);
} }
bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileName) bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileName)
{ {
const QString title(tr("ClearCase Remove Element")); const QString title(tr("ClearCase Remove Element %1").arg(baseName(fileName)));
if (QMessageBox::warning(0, title, tr("This operation is irreversible. Are you sure?"), if (QMessageBox::warning(0, title, tr("This operation is irreversible. Are you sure?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
return true; return true;
return ccFileOp(workingDir, tr("ClearCase Remove File"), return ccFileOp(workingDir, tr("ClearCase Remove File %1").arg(baseName(fileName)),
QStringList() << QLatin1String("rmname") << QLatin1String("-force"), fileName); QStringList() << QLatin1String("rmname") << QLatin1String("-force"), fileName);
} }
bool ClearCasePlugin::vcsMove(const QString &workingDir, const QString &from, const QString &to) bool ClearCasePlugin::vcsMove(const QString &workingDir, const QString &from, const QString &to)
{ {
return ccFileOp(workingDir, tr("ClearCase Rename File"), return ccFileOp(workingDir, tr("ClearCase Rename File %1 -> %2")
.arg(baseName(from)).arg(baseName(to)),
QStringList() << QLatin1String("move"), from, to); QStringList() << QLatin1String("move"), from, to);
} }
@@ -1533,7 +1590,7 @@ QString ClearCasePlugin::vcsGetRepositoryURL(const QString & /*directory*/)
return currentState().topLevel(); return currentState().topLevel();
} }
// ClearCase has "view.dat" file in the root directory it manages. // ClearCase has "view.dat" file in the root directory it manages for snapshot views.
bool ClearCasePlugin::managesDirectory(const QString &directory, QString *topLevel /* = 0 */) const bool ClearCasePlugin::managesDirectory(const QString &directory, QString *topLevel /* = 0 */) const
{ {
QString topLevelFound = findTopLevel(directory); QString topLevelFound = findTopLevel(directory);
@@ -1640,7 +1697,18 @@ bool ClearCasePlugin::newActivity()
return (!response.error); return (!response.error);
} }
QString ClearCasePlugin::ccGetView(const QString &workingDir, bool *isDynamic) const // check if the view is UCM
bool ClearCasePlugin::ccCheckUcm(const QString &viewname, const QString &workingDir) const
{
QStringList catcsArgs(QLatin1String("catcs"));
catcsArgs << QLatin1String("-tag") << viewname;
QString catcsData = runCleartoolSync(workingDir, catcsArgs);
// check output for the word "ucm"
return QRegExp(QLatin1String("(^|\\n)ucm\\n")).indexIn(catcsData) != -1;
}
QString ClearCasePlugin::ccGetView(const QString &workingDir, bool *isDynamic, bool *isUcm) const
{ {
QStringList args(QLatin1String("lsview")); QStringList args(QLatin1String("lsview"));
args << QLatin1String("-cview"); args << QLatin1String("-cview");
@@ -1652,7 +1720,13 @@ QString ClearCasePlugin::ccGetView(const QString &workingDir, bool *isDynamic) c
} }
if (isDynamic) if (isDynamic)
*isDynamic = !data.isEmpty() && (data.at(0) == QLatin1Char('*')); *isDynamic = !data.isEmpty() && (data.at(0) == QLatin1Char('*'));
return data.mid(2, data.indexOf(QLatin1Char(' '), 2) - 2);
QString viewname = data.mid(2, data.indexOf(QLatin1Char(' '), 2) - 2);
if (isUcm)
*isUcm = ccCheckUcm(viewname, workingDir);
return viewname;
} }
void ClearCasePlugin::updateStreamAndView() void ClearCasePlugin::updateStreamAndView()
@@ -1665,8 +1739,8 @@ void ClearCasePlugin::updateStreamAndView()
QRegExp intStreamExp(QLatin1String("stream:([^@]*)")); QRegExp intStreamExp(QLatin1String("stream:([^@]*)"));
if (intStreamExp.indexIn(sresponse.mid(tabPos + 1)) != -1) if (intStreamExp.indexIn(sresponse.mid(tabPos + 1)) != -1)
m_intStream = intStreamExp.cap(1); m_intStream = intStreamExp.cap(1);
m_view = ccGetView(m_topLevel); m_view = ccGetView(m_topLevel, &m_isDynamic, &m_isUcm);
m_updateViewAction->setParameter(m_view); m_updateViewAction->setParameter(m_isDynamic ? QString() : m_view);
} }
void ClearCasePlugin::projectChanged(ProjectExplorer::Project *project) void ClearCasePlugin::projectChanged(ProjectExplorer::Project *project)

View File

@@ -118,7 +118,7 @@ public:
bool initialize(const QStringList &arguments, QString *error_message); bool initialize(const QStringList &arguments, QString *error_message);
ClearCaseSubmitEditor *openClearCaseSubmitEditor(const QString &fileName); ClearCaseSubmitEditor *openClearCaseSubmitEditor(const QString &fileName, bool isUcm);
const ClearCaseSettings &settings() const; const ClearCaseSettings &settings() const;
void setSettings(const ClearCaseSettings &s); void setSettings(const ClearCaseSettings &s);
@@ -148,6 +148,9 @@ public:
FileStatus vcsStatus(const QString &file) const; FileStatus vcsStatus(const QString &file) const;
QString currentView() const { return m_view; } QString currentView() const { return m_view; }
void refreshActivities(); void refreshActivities();
inline bool isUcm() const { return m_isUcm; }
bool ccCheckUcm(const QString &viewname, const QString &workingDir) const;
public slots: public slots:
void vcsAnnotate(const QString &workingDir, const QString &file, void vcsAnnotate(const QString &workingDir, const QString &file,
@@ -216,7 +219,7 @@ private:
static void rmdir(const QString &path); static void rmdir(const QString &path);
QString runExtDiff(const QString &workingDir, const QStringList &arguments, QString runExtDiff(const QString &workingDir, const QStringList &arguments,
int timeOut, QTextCodec *outputCodec = 0); int timeOut, QTextCodec *outputCodec = 0);
QString ccGetView(const QString &workingDir, bool *isDynamic = 0) const; QString ccGetView(const QString &workingDir, bool *isDynamic = 0, bool *isUcm = 0) const;
ClearCaseSettings m_settings; ClearCaseSettings m_settings;
@@ -225,6 +228,8 @@ private:
QString m_topLevel; QString m_topLevel;
QString m_stream; QString m_stream;
QString m_view; QString m_view;
bool m_isDynamic;
bool m_isUcm;
QString m_intStream; QString m_intStream;
QString m_activity; QString m_activity;
QString m_diffPrefix; QString m_diffPrefix;

View File

@@ -50,6 +50,11 @@ ClearCaseSubmitEditorWidget *ClearCaseSubmitEditor::submitEditorWidget()
return static_cast<ClearCaseSubmitEditorWidget *>(widget()); return static_cast<ClearCaseSubmitEditorWidget *>(widget());
} }
void ClearCaseSubmitEditor::setIsUcm(bool isUcm)
{
submitEditorWidget()->addActivitySelector(isUcm);
}
void ClearCaseSubmitEditor::setStatusList(const QStringList &statusOutput) void ClearCaseSubmitEditor::setStatusList(const QStringList &statusOutput)
{ {
typedef QStringList::const_iterator ConstIterator; typedef QStringList::const_iterator ConstIterator;

View File

@@ -54,8 +54,11 @@ public:
void setStatusList(const QStringList &statusOutput); void setStatusList(const QStringList &statusOutput);
ClearCaseSubmitEditorWidget *submitEditorWidget(); ClearCaseSubmitEditorWidget *submitEditorWidget();
void setIsUcm(bool isUcm);
protected: protected:
virtual QByteArray fileContents() const; virtual QByteArray fileContents() const;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -42,32 +42,26 @@
using namespace ClearCase::Internal; using namespace ClearCase::Internal;
ClearCaseSubmitEditorWidget::ClearCaseSubmitEditorWidget(QWidget *parent) : ClearCaseSubmitEditorWidget::ClearCaseSubmitEditorWidget(QWidget *parent) :
Utils::SubmitEditorWidget(parent) Utils::SubmitEditorWidget(parent),
m_actSelector(0)
{ {
setDescriptionMandatory(false); setDescriptionMandatory(false);
QWidget *checkInWidget = new QWidget(this); QWidget *checkInWidget = new QWidget(this);
QVBoxLayout *verticalLayout = new QVBoxLayout(checkInWidget); m_verticalLayout = new QVBoxLayout(checkInWidget);
m_actSelector = new ActivitySelector;
verticalLayout->addWidget(m_actSelector);
QFrame *line = new QFrame;
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
verticalLayout->addWidget(line);
m_chkIdentical = new QCheckBox(tr("Chec&k in even if identical to previous version")); m_chkIdentical = new QCheckBox(tr("Chec&k in even if identical to previous version"));
verticalLayout->addWidget(m_chkIdentical); m_verticalLayout->addWidget(m_chkIdentical);
m_chkPTime = new QCheckBox(tr("&Preserve file modification time")); m_chkPTime = new QCheckBox(tr("&Preserve file modification time"));
verticalLayout->addWidget(m_chkPTime); m_verticalLayout->addWidget(m_chkPTime);
insertTopWidget(checkInWidget); insertTopWidget(checkInWidget);
} }
QString ClearCaseSubmitEditorWidget::activity() const QString ClearCaseSubmitEditorWidget::activity() const
{ {
return m_actSelector->activity(); return m_actSelector ? m_actSelector->activity() : QString();
} }
bool ClearCaseSubmitEditorWidget::isIdentical() const bool ClearCaseSubmitEditorWidget::isIdentical() const
@@ -82,19 +76,36 @@ bool ClearCaseSubmitEditorWidget::isPreserve() const
void ClearCaseSubmitEditorWidget::setActivity(const QString &act) void ClearCaseSubmitEditorWidget::setActivity(const QString &act)
{ {
if (m_actSelector)
m_actSelector->setActivity(act); m_actSelector->setActivity(act);
} }
bool ClearCaseSubmitEditorWidget::activityChanged() const bool ClearCaseSubmitEditorWidget::activityChanged() const
{ {
return m_actSelector->changed(); return m_actSelector ? m_actSelector->changed() : false;
} }
void ClearCaseSubmitEditorWidget::addKeep() void ClearCaseSubmitEditorWidget::addKeep()
{ {
if (m_actSelector)
m_actSelector->addKeep(); m_actSelector->addKeep();
} }
//! Add the ActivitySelector if \a isUcm is set
void ClearCaseSubmitEditorWidget::addActivitySelector(bool isUcm)
{
if (!isUcm || m_actSelector)
return;
m_actSelector = new ActivitySelector;
m_verticalLayout->insertWidget(0, m_actSelector);
QFrame* line = new QFrame;
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
m_verticalLayout->insertWidget(1, line);
}
QString ClearCaseSubmitEditorWidget::commitName() const QString ClearCaseSubmitEditorWidget::commitName() const
{ {
return tr("&Check In"); return tr("&Check In");

View File

@@ -37,6 +37,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QCheckBox; class QCheckBox;
class QVBoxLayout;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace ClearCase { namespace ClearCase {
@@ -56,6 +57,7 @@ public:
void setActivity(const QString &act); void setActivity(const QString &act);
bool activityChanged() const; bool activityChanged() const;
void addKeep(); void addKeep();
void addActivitySelector(bool isUcm);
protected: protected:
QString commitName() const; QString commitName() const;
@@ -64,6 +66,7 @@ private:
ActivitySelector *m_actSelector; ActivitySelector *m_actSelector;
QCheckBox *m_chkIdentical; QCheckBox *m_chkIdentical;
QCheckBox *m_chkPTime; QCheckBox *m_chkPTime;
QVBoxLayout *m_verticalLayout;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -1,4 +1,5 @@
#include "clearcasesync.h" #include "clearcasesync.h"
#include "clearcaseconstants.h"
#include <QDir> #include <QDir>
#include <QFutureInterface> #include <QFutureInterface>
@@ -30,6 +31,7 @@ void ClearCaseSync::run(QFutureInterface<void> &future, const QString &topLevel,
total = settings.totalFiles.value(view, total); total = settings.totalFiles.value(view, total);
// refresh activities list // refresh activities list
if (m_plugin->isUcm())
m_plugin->refreshActivities(); m_plugin->refreshActivities();
if (settings.disableIndexer) if (settings.disableIndexer)
@@ -66,6 +68,7 @@ void ClearCaseSync::run(QFutureInterface<void> &future, const QString &topLevel,
future.setProgressRange(0, total + 1); future.setProgressRange(0, total + 1);
QProcess process; QProcess process;
process.setWorkingDirectory(topLevel); process.setWorkingDirectory(topLevel);
process.start(program, args); process.start(program, args);
if (!process.waitForStarted()) if (!process.waitForStarted())
return; return;
@@ -75,6 +78,7 @@ void ClearCaseSync::run(QFutureInterface<void> &future, const QString &topLevel,
process.bytesAvailable() && !future.isCanceled()) process.bytesAvailable() && !future.isCanceled())
{ {
QString line = QString::fromLocal8Bit(process.readLine().constData()); QString line = QString::fromLocal8Bit(process.readLine().constData());
buffer += line; buffer += line;
if (buffer.endsWith(QLatin1Char('\n')) || process.atEnd()) { if (buffer.endsWith(QLatin1Char('\n')) || process.atEnd()) {
int atatpos = buffer.indexOf(QLatin1String("@@")); int atatpos = buffer.indexOf(QLatin1String("@@"));

View File

@@ -237,7 +237,7 @@ else:unix {
for(imagesize, IMAGE_SIZE_LIST) { for(imagesize, IMAGE_SIZE_LIST) {
eval(image$${imagesize}.files = images/logo/$${imagesize}/qtcreator.png) eval(image$${imagesize}.files = images/logo/$${imagesize}/qtcreator.png)
eval(image$${imagesize}.path = /share/icons/hicolor/$${imagesize}x$${imagesize}/apps) eval(image$${imagesize}.path = $$QTC_PREFIX/share/icons/hicolor/$${imagesize}x$${imagesize}/apps)
INSTALLS += image$${imagesize} INSTALLS += image$${imagesize}
} }
} }

View File

@@ -903,10 +903,22 @@ void CPPEditorWidget::onContentsChanged(int position, int charsRemoved, int char
void CPPEditorWidget::updateFileName() void CPPEditorWidget::updateFileName()
{} {}
void CPPEditorWidget::jumpToOutlineElement(int) void CPPEditorWidget::jumpToOutlineElement(int index)
{ {
QModelIndex index = m_proxyModel->mapToSource(m_outlineCombo->view()->currentIndex()); QModelIndex modelIndex = m_outlineCombo->view()->currentIndex();
Symbol *symbol = m_outlineModel->symbolFromIndex(index); // When the user clicks on an item in the combo box,
// the view's currentIndex is updated, so we want to use that.
// When the scroll wheel was used on the combo box,
// the view's currentIndex is not updated,
// but the passed index to this method is correct.
// So, if the view has a current index, we reset it, to be able
// to distinguish wheel events later
if (modelIndex.isValid())
m_outlineCombo->view()->setCurrentIndex(QModelIndex());
else
modelIndex = m_proxyModel->index(index, 0); // toplevel index
QModelIndex sourceIndex = m_proxyModel->mapToSource(modelIndex);
Symbol *symbol = m_outlineModel->symbolFromIndex(sourceIndex);
if (! symbol) if (! symbol)
return; return;

View File

@@ -272,9 +272,8 @@ KitConfigWidget *DebuggerKitInformation::createConfigWidget(Kit *k) const
QString DebuggerKitInformation::userOutput(const DebuggerItem &item) QString DebuggerKitInformation::userOutput(const DebuggerItem &item)
{ {
const QString binary = item.binary.toUserOutput(); const QString binary = item.binary.toUserOutput();
return binary.isEmpty() ? const QString name = debuggerEngineName(item.engineType);
tr("%1 <None>").arg(debuggerEngineName(item.engineType)) : return binary.isEmpty() ? tr("%1 <None>").arg(name) : tr("%1 using \"%2\"").arg(name, binary);
tr("%1 using '%2'").arg(debuggerEngineName(item.engineType), binary);
} }
KitInformation::ItemList DebuggerKitInformation::toUserOutput(Kit *k) const KitInformation::ItemList DebuggerKitInformation::toUserOutput(Kit *k) const

View File

@@ -1459,7 +1459,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
} }
} }
} }
if (fillParameters(&sp, kit, errorMessage)) if (!fillParameters(&sp, kit, errorMessage))
return false; return false;
if (sp.startMode == StartExternal) { if (sp.startMode == StartExternal) {
sp.displayName = tr("Executable file \"%1\"").arg(sp.executable); sp.displayName = tr("Executable file \"%1\"").arg(sp.executable);

View File

@@ -232,7 +232,6 @@ QDataStream &operator<<(QDataStream &stream, const WatchData &wd)
stream << wd.valueEditable; stream << wd.valueEditable;
stream << wd.error; stream << wd.error;
stream << wd.state; stream << wd.state;
stream << wd.changed;
return stream; return stream;
} }
@@ -257,7 +256,6 @@ QDataStream &operator>>(QDataStream &stream, WatchData &wd)
stream >> wd.valueEditable; stream >> wd.valueEditable;
stream >> wd.error; stream >> wd.error;
stream >> wd.state; stream >> wd.state;
stream >> wd.changed;
return stream; return stream;
} }

View File

@@ -4113,6 +4113,7 @@ void GdbEngine::handleDebuggingHelperSetup(const GdbResponse &response)
void GdbEngine::updateLocals() void GdbEngine::updateLocals()
{ {
watchHandler()->resetValueCache();
if (hasPython()) if (hasPython())
updateLocalsPython(UpdateParameters()); updateLocalsPython(UpdateParameters());
else else

View File

@@ -111,6 +111,8 @@ public:
m_width(rect.width()), m_width(rect.width()),
m_top(rect.top()), m_top(rect.top()),
m_bottom(rect.bottom()), m_bottom(rect.bottom()),
m_maxFileLength(0),
m_maxLineLength(0),
m_showTaskIconArea(showTaskIconArea), m_showTaskIconArea(showTaskIconArea),
m_showExpandableIconArea(showExpandableIconArea) m_showExpandableIconArea(showExpandableIconArea)
{ {

View File

@@ -294,6 +294,12 @@ static int bitWidthFromType(int type, int subType)
return 0; return 0;
} }
static const int TopLevelId = -1;
static bool isTopLevelItem(const QModelIndex &index)
{
return quintptr(index.internalId()) == quintptr(TopLevelId);
}
Register::Register(const QByteArray &name_) Register::Register(const QByteArray &name_)
: name(name_), changed(true) : name(name_), changed(true)
{ {
@@ -322,7 +328,7 @@ int RegisterHandler::rowCount(const QModelIndex &idx) const
return 0; return 0;
if (!idx.isValid()) if (!idx.isValid())
return m_registers.size(); // Top level. return m_registers.size(); // Top level.
if (idx.internalId() >= 0) if (!isTopLevelItem(idx))
return 0; // Sub-Items don't have children. return 0; // Sub-Items don't have children.
if (idx.row() >= m_registers.size()) if (idx.row() >= m_registers.size())
return 0; return 0;
@@ -335,7 +341,7 @@ int RegisterHandler::columnCount(const QModelIndex &idx) const
return 0; return 0;
if (!idx.isValid()) if (!idx.isValid())
return 2; return 2;
if (idx.internalId() >= 0) if (!isTopLevelItem(idx))
return 0; // Sub-Items don't have children. return 0; // Sub-Items don't have children.
return 2; return 2;
} }
@@ -345,8 +351,8 @@ QModelIndex RegisterHandler::index(int row, int col, const QModelIndex &parent)
if (row < 0 || col < 0 || col >= 2) if (row < 0 || col < 0 || col >= 2)
return QModelIndex(); return QModelIndex();
if (!parent.isValid()) // Top level. if (!parent.isValid()) // Top level.
return createIndex(row, col, -1); return createIndex(row, col, TopLevelId);
if (parent.internalId() >= 0) // Sub-Item has no children. if (!isTopLevelItem(parent)) // Sub-Item has no children.
return QModelIndex(); return QModelIndex();
if (parent.column() > 0) if (parent.column() > 0)
return QModelIndex(); return QModelIndex();
@@ -357,8 +363,8 @@ QModelIndex RegisterHandler::parent(const QModelIndex &idx) const
{ {
if (!idx.isValid()) if (!idx.isValid())
return QModelIndex(); return QModelIndex();
if (idx.internalId() >= 0) if (!isTopLevelItem(idx))
return createIndex(idx.internalId(), 0, -1); return createIndex(idx.internalId(), 0, TopLevelId);
return QModelIndex(); return QModelIndex();
} }

View File

@@ -128,7 +128,6 @@ WatchData::WatchData() :
valueEnabled(true), valueEnabled(true),
valueEditable(true), valueEditable(true),
error(false), error(false),
changed(false),
sortId(0), sortId(0),
source(0) source(0)
{ {
@@ -428,11 +427,6 @@ QByteArray WatchData::hexReferencingAddress() const
return QByteArray(); return QByteArray();
} }
bool WatchData::hasChanged(const WatchData &old) const
{
return !value.isEmpty() && value != old.value && value != msgNotInScope();
}
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger

View File

@@ -113,7 +113,6 @@ public:
quint64 coreAddress() const; quint64 coreAddress() const;
QByteArray hexAddress() const; QByteArray hexAddress() const;
QByteArray hexReferencingAddress() const; QByteArray hexReferencingAddress() const;
bool hasChanged(const WatchData &old) const;
public: public:
quint64 id; // Token for the engine for internal mapping quint64 id; // Token for the engine for internal mapping
@@ -137,7 +136,6 @@ public:
bool valueEnabled; // Value will be enabled or not bool valueEnabled; // Value will be enabled or not
bool valueEditable; // Value will be editable bool valueEditable; // Value will be editable
bool error; bool error;
bool changed;
qint32 sortId; qint32 sortId;
QByteArray dumperFlags; QByteArray dumperFlags;

View File

@@ -177,7 +177,7 @@ private:
void fetchMore(const QModelIndex &parent); void fetchMore(const QModelIndex &parent);
void invalidateAll(const QModelIndex &parentIndex = QModelIndex()); void invalidateAll(const QModelIndex &parentIndex = QModelIndex());
void setUnchangedRecursively(WatchItem *item); void resetValueCacheRecursively(WatchItem *item);
WatchItem *createItem(const QByteArray &iname, const QString &name, WatchItem *parent); WatchItem *createItem(const QByteArray &iname, const QString &name, WatchItem *parent);
@@ -188,7 +188,7 @@ private:
QModelIndex watchIndexHelper(const WatchItem *needle, QModelIndex watchIndexHelper(const WatchItem *needle,
const WatchItem *parentItem, const QModelIndex &parentIndex) const; const WatchItem *parentItem, const QModelIndex &parentIndex) const;
void insertDataItem(const WatchData &data, bool destructive = true); void insertDataItem(const WatchData &data, bool destructive);
Q_SLOT void reinsertAllData(); Q_SLOT void reinsertAllData();
void reinsertAllDataHelper(WatchItem *item, QList<WatchData> *data); void reinsertAllDataHelper(WatchItem *item, QList<WatchData> *data);
bool ancestorChanged(const QSet<QByteArray> &parentINames, WatchItem *item) const; bool ancestorChanged(const QSet<QByteArray> &parentINames, WatchItem *item) const;
@@ -246,6 +246,8 @@ private:
friend class WatchItem; friend class WatchItem;
typedef QHash<QByteArray, WatchItem *> Cache; typedef QHash<QByteArray, WatchItem *> Cache;
Cache m_cache; Cache m_cache;
typedef QHash<QByteArray, QString> ValueCache;
ValueCache m_valueCache;
#if USE_EXPENSIVE_CHECKS #if USE_EXPENSIVE_CHECKS
QHash<const WatchItem *, QByteArray> m_cache2; QHash<const WatchItem *, QByteArray> m_cache2;
@@ -859,12 +861,12 @@ void WatchModel::invalidateAll(const QModelIndex &parentIndex)
emit dataChanged(idx1, idx2); emit dataChanged(idx1, idx2);
} }
void WatchModel::setUnchangedRecursively(WatchItem *item) void WatchModel::resetValueCacheRecursively(WatchItem *item)
{ {
item->changed = false; m_valueCache[item->iname] = item->value;
const WatchItems &items = item->children; const WatchItems &items = item->children;
for (int i = items.size(); --i >= 0; ) for (int i = items.size(); --i >= 0; )
setUnchangedRecursively(items.at(i)); resetValueCacheRecursively(items.at(i));
} }
// Truncate value for item view, maintaining quotes. // Truncate value for item view, maintaining quotes.
@@ -1028,9 +1030,11 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
case Qt::ForegroundRole: { case Qt::ForegroundRole: {
static const QVariant red(QColor(200, 0, 0)); static const QVariant red(QColor(200, 0, 0));
static const QVariant gray(QColor(140, 140, 140)); static const QVariant gray(QColor(140, 140, 140));
switch (idx.column()) { if (idx.column() == 1) {
case 1: return (!data.valueEnabled || !contentIsValid()) ? gray if (!data.valueEnabled || !contentIsValid())
: data.changed ? red : QVariant(); return gray;
if (data.value != m_valueCache.value(data.iname))
return red;
} }
break; break;
} }
@@ -1314,9 +1318,7 @@ void WatchModel::insertDataItem(const WatchData &data, bool destructive)
destroyChildren(item); destroyChildren(item);
// Overwrite old entry. // Overwrite old entry.
bool hasChanged = item->hasChanged(data);
assignData(item, data); assignData(item, data);
item->changed = hasChanged;
QModelIndex idx = watchIndex(item); QModelIndex idx = watchIndex(item);
emit dataChanged(idx, idx.sibling(idx.row(), 2)); emit dataChanged(idx, idx.sibling(idx.row(), 2));
} else { } else {
@@ -1325,7 +1327,6 @@ void WatchModel::insertDataItem(const WatchData &data, bool destructive)
QTC_ASSERT(parent, return); QTC_ASSERT(parent, return);
WatchItem *newItem = createItem(data); WatchItem *newItem = createItem(data);
newItem->parent = parent; newItem->parent = parent;
newItem->changed = true;
const int row = findInsertPosition(parent->children, newItem); const int row = findInsertPosition(parent->children, newItem);
QModelIndex idx = watchIndex(parent); QModelIndex idx = watchIndex(parent);
beginInsertRows(idx, row, row); beginInsertRows(idx, row, row);
@@ -1353,7 +1354,7 @@ void WatchModel::insertBulkData(const QList<WatchData> &list)
#if 1 #if 1
for (int i = 0, n = list.size(); i != n; ++i) { for (int i = 0, n = list.size(); i != n; ++i) {
const WatchData &data = list.at(i); const WatchData &data = list.at(i);
insertDataItem(data); insertDataItem(data, true);
m_handler->showEditValue(data); m_handler->showEditValue(data);
} }
#else #else
@@ -1483,7 +1484,7 @@ void WatchHandler::insertIncompleteData(const WatchData &data)
if (data.isSomethingNeeded() && data.iname.contains('.')) { if (data.isSomethingNeeded() && data.iname.contains('.')) {
MODEL_DEBUG("SOMETHING NEEDED: " << data.toString()); MODEL_DEBUG("SOMETHING NEEDED: " << data.toString());
if (!m_engine->isSynchronous() || data.isInspect()) { if (!m_engine->isSynchronous() || data.isInspect()) {
m_model->insertDataItem(data); m_model->insertDataItem(data, true);
m_engine->updateWatchData(data); m_engine->updateWatchData(data);
} else { } else {
m_engine->showMessage(QLatin1String("ENDLESS LOOP: SOMETHING NEEDED: ") m_engine->showMessage(QLatin1String("ENDLESS LOOP: SOMETHING NEEDED: ")
@@ -1492,11 +1493,11 @@ void WatchHandler::insertIncompleteData(const WatchData &data)
data1.setAllUnneeded(); data1.setAllUnneeded();
data1.setValue(QLatin1String("<unavailable synchronous data>")); data1.setValue(QLatin1String("<unavailable synchronous data>"));
data1.setHasChildren(false); data1.setHasChildren(false);
m_model->insertDataItem(data1); m_model->insertDataItem(data1, true);
} }
} else { } else {
MODEL_DEBUG("NOTHING NEEDED: " << data.toString()); MODEL_DEBUG("NOTHING NEEDED: " << data.toString());
m_model->insertDataItem(data); m_model->insertDataItem(data, true);
showEditValue(data); showEditValue(data);
} }
} }
@@ -1522,9 +1523,10 @@ void WatchHandler::removeAllData()
updateWatchersWindow(); updateWatchersWindow();
} }
void WatchHandler::markAllUnchanged() void WatchHandler::resetValueCache()
{ {
m_model->setUnchangedRecursively(m_model->m_root); m_model->m_valueCache.clear();
m_model->resetValueCacheRecursively(m_model->m_root);
} }
void WatchHandler::removeData(const QByteArray &iname) void WatchHandler::removeData(const QByteArray &iname)

View File

@@ -132,7 +132,7 @@ public:
void removeData(const QByteArray &iname); void removeData(const QByteArray &iname);
void removeChildren(const QByteArray &iname); void removeChildren(const QByteArray &iname);
void removeAllData(); void removeAllData();
void markAllUnchanged(); void resetValueCache();
private: private:
friend class WatchModel; friend class WatchModel;

View File

@@ -550,7 +550,11 @@ void WatchTreeView::dragMoveEvent(QDragMoveEvent *ev)
void WatchTreeView::dropEvent(QDropEvent *ev) void WatchTreeView::dropEvent(QDropEvent *ev)
{ {
if (ev->mimeData()->hasText()) { if (ev->mimeData()->hasText()) {
watchExpression(ev->mimeData()->text()); QString exp;
QString data = ev->mimeData()->text();
foreach (const QChar c, data)
exp.append(c.isPrint() ? c : QChar(QLatin1Char(' ')));
watchExpression(exp);
//ev->acceptProposedAction(); //ev->acceptProposedAction();
ev->setDropAction(Qt::CopyAction); ev->setDropAction(Qt::CopyAction);
ev->accept(); ev->accept();

View File

@@ -44,6 +44,7 @@
#if defined(QT_NO_WEBKIT) #if defined(QT_NO_WEBKIT)
#include <QTextBrowser> #include <QTextBrowser>
#else #else
#include <QWebPage>
#include <QWebView> #include <QWebView>
#endif #endif
@@ -140,6 +141,33 @@ private:
HelpViewerPrivate *d; HelpViewerPrivate *d;
}; };
#ifndef QT_NO_WEBKIT
class HelpPage : public QWebPage
{
Q_OBJECT
public:
HelpPage(QObject *parent);
protected:
virtual QWebPage *createWindow(QWebPage::WebWindowType);
virtual void triggerAction(WebAction action, bool checked = false);
virtual bool acceptNavigationRequest(QWebFrame *frame,
const QNetworkRequest &request, NavigationType type);
private slots:
void onHandleUnsupportedContent(QNetworkReply *reply);
private:
QUrl m_loadingUrl;
bool closeNewTabIfNeeded;
friend class Help::Internal::HelpViewer;
Qt::MouseButtons m_pressedButtons;
Qt::KeyboardModifiers m_keyboardModifiers;
};
#endif // QT_NO_WEBKIT
} // namespace Internal } // namespace Internal
} // namespace Help } // namespace Help

View File

@@ -208,35 +208,6 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op,
? QLatin1String("application/octet-stream") : mimeType); ? QLatin1String("application/octet-stream") : mimeType);
} }
// -- HelpPage
class HelpPage : public QWebPage
{
Q_OBJECT
public:
HelpPage(QObject *parent);
protected:
virtual QWebPage *createWindow(QWebPage::WebWindowType);
virtual void triggerAction(WebAction action, bool checked = false);
virtual bool acceptNavigationRequest(QWebFrame *frame,
const QNetworkRequest &request, NavigationType type);
private slots:
void onHandleUnsupportedContent(QNetworkReply *reply);
private:
QUrl m_loadingUrl;
bool closeNewTabIfNeeded;
friend class Help::Internal::HelpViewer;
Qt::MouseButtons m_pressedButtons;
Qt::KeyboardModifiers m_keyboardModifiers;
};
#include "helpviewer_qwv.moc"
// - HelpPage // - HelpPage
HelpPage::HelpPage(QObject *parent) HelpPage::HelpPage(QObject *parent)

View File

@@ -135,13 +135,14 @@ static QList<Abi> parseCoffHeader(const QByteArray &data)
break; break;
} }
if (data.size() >= 68) { if (data.size() >= 24) {
// Get Major and Minor Image Version from optional header fields // Get Major and Minor Image Version from optional header fields
quint32 image = getLEUint32(data, 64); quint8 minorLinker = data.at(23);
if (image == 1) { // Image is 1 for mingw and higher for MSVC (4.something in some encoding)
flavor = Abi::WindowsMSysFlavor;
} else {
switch (data.at(22)) { switch (data.at(22)) {
case 2:
case 3: // not yet reached:-)
flavor = Abi::WindowsMSysFlavor;
break;
case 8: case 8:
flavor = Abi::WindowsMsvc2005Flavor; flavor = Abi::WindowsMsvc2005Flavor;
break; break;
@@ -155,11 +156,13 @@ static QList<Abi> parseCoffHeader(const QByteArray &data)
flavor = Abi::WindowsMsvc2012Flavor; flavor = Abi::WindowsMsvc2012Flavor;
break; break;
default: // Keep unknown flavor default: // Keep unknown flavor
if (minorLinker != 0)
flavor = Abi::WindowsMSysFlavor; // MSVC seems to avoid using minor numbers
else
qWarning("%s: Unknown MSVC flavour encountered.", Q_FUNC_INFO); qWarning("%s: Unknown MSVC flavour encountered.", Q_FUNC_INFO);
break; break;
} }
} }
}
if (arch != Abi::UnknownArchitecture && width != 0) if (arch != Abi::UnknownArchitecture && width != 0)
result.append(Abi(arch, Abi::WindowsOS, flavor, Abi::PEFormat, width)); result.append(Abi(arch, Abi::WindowsOS, flavor, Abi::PEFormat, width));
@@ -791,9 +794,6 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
<< QString::fromLatin1("ppc-macos-generic-mach_o-32bit") << QString::fromLatin1("ppc-macos-generic-mach_o-32bit")
<< QString::fromLatin1("x86-macos-generic-mach_o-64bit")); << QString::fromLatin1("x86-macos-generic-mach_o-64bit"));
QTest::newRow("dynamic QtCore: win msvc2012 64bit")
<< QString::fromLatin1("/tmp/win-msvc2012-64bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msvc2012-pe-64bit"));
QTest::newRow("dynamic QtCore: win msvc2010 64bit") QTest::newRow("dynamic QtCore: win msvc2010 64bit")
<< QString::fromLatin1("%1/dynamic/win-msvc2010-64bit.dll").arg(prefix) << QString::fromLatin1("%1/dynamic/win-msvc2010-64bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msvc2010-pe-64bit")); << (QStringList() << QString::fromLatin1("x86-windows-msvc2010-pe-64bit"));
@@ -806,6 +806,9 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
QTest::newRow("dynamic QtCore: win msys 32bit") QTest::newRow("dynamic QtCore: win msys 32bit")
<< QString::fromLatin1("%1/dynamic/win-mingw-32bit.dll").arg(prefix) << QString::fromLatin1("%1/dynamic/win-mingw-32bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msys-pe-32bit")); << (QStringList() << QString::fromLatin1("x86-windows-msys-pe-32bit"));
QTest::newRow("dynamic QtCore: win mingw 64bit")
<< QString::fromLatin1("%1/dynamic/win-mingw-64bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msys-pe-64bit"));
QTest::newRow("dynamic QtCore: wince msvc2005 32bit") QTest::newRow("dynamic QtCore: wince msvc2005 32bit")
<< QString::fromLatin1("%1/dynamic/wince-32bit.dll").arg(prefix) << QString::fromLatin1("%1/dynamic/wince-32bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("mips-windows-msvc2005-pe-32bit")); << (QStringList() << QString::fromLatin1("mips-windows-msvc2005-pe-32bit"));

View File

@@ -78,7 +78,7 @@ bool DeviceProcessList::hasChildren(const QModelIndex &parent) const
QModelIndex DeviceProcessList::index(int row, int column, const QModelIndex &parent) const QModelIndex DeviceProcessList::index(int row, int column, const QModelIndex &parent) const
{ {
return hasIndex(row, column, parent) ? createIndex(row, column, 0) : QModelIndex(); return hasIndex(row, column, parent) ? createIndex(row, column) : QModelIndex();
} }

View File

@@ -176,10 +176,15 @@ static QList<DeviceProcess> getLocalProcessesUsingProc(const QDir &procDir)
DeviceProcess proc; DeviceProcess proc;
proc.pid = procId.toInt(); proc.pid = procId.toInt();
const QString root = procDirPath + procId; const QString root = procDirPath + procId;
QFile exeFile(root + QLatin1String("/exe"));
proc.exe = exeFile.symLinkTarget();
QFile cmdLineFile(root + QLatin1String("/cmdline")); QFile cmdLineFile(root + QLatin1String("/cmdline"));
if (cmdLineFile.open(QIODevice::ReadOnly)) { // process may have exited if (cmdLineFile.open(QIODevice::ReadOnly)) { // process may have exited
QList<QByteArray> tokens = cmdLineFile.readAll().split('\0'); QList<QByteArray> tokens = cmdLineFile.readAll().split('\0');
if (!tokens.isEmpty()) { if (!tokens.isEmpty()) {
if (proc.exe.isEmpty())
proc.exe = QString::fromLocal8Bit(tokens.front()); proc.exe = QString::fromLocal8Bit(tokens.front());
foreach (const QByteArray &t, tokens) { foreach (const QByteArray &t, tokens) {
if (!proc.cmdLine.isEmpty()) if (!proc.cmdLine.isEmpty())

View File

@@ -48,12 +48,6 @@ class PROJECTEXPLORER_EXPORT KitConfigWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
enum LayoutColumns {
LabelColumn,
WidgetColumn,
ButtonColumn
};
KitConfigWidget(QWidget *parent = 0) : QWidget(parent) KitConfigWidget(QWidget *parent = 0) : QWidget(parent)
{ } { }
@@ -66,14 +60,8 @@ public:
virtual QWidget *buttonWidget() const { return 0; } virtual QWidget *buttonWidget() const { return 0; }
virtual void addToLayout(QGridLayout *layout, int row);
signals: signals:
void dirty(); void dirty();
protected:
void addLabel(QGridLayout *layout, int row);
void addButtonWidget(QGridLayout *layout, int row);
}; };
} // namespace ProjectExplorer } // namespace ProjectExplorer

View File

@@ -202,7 +202,19 @@ ToolChain *ToolChainKitInformation::toolChain(const Kit *k)
if (!k) if (!k)
return 0; return 0;
const QString id = k->value(Core::Id(TOOLCHAIN_INFORMATION)).toString(); const QString id = k->value(Core::Id(TOOLCHAIN_INFORMATION)).toString();
return ToolChainManager::instance()->findToolChain(id); if (id.isEmpty())
return 0;
ToolChain *tc = ToolChainManager::instance()->findToolChain(id);
if (tc)
return tc;
// ID is not found: Might be an ABI string...
foreach (ToolChain *current, ToolChainManager::instance()->toolChains()) {
if (current->targetAbi().toString() == id)
return current;
}
return 0;
} }
void ToolChainKitInformation::setToolChain(Kit *k, ToolChain *tc) void ToolChainKitInformation::setToolChain(Kit *k, ToolChain *tc)

View File

@@ -367,7 +367,7 @@ QList<KitInformation *> KitManager::kitInformation() const
return d->m_informationList; return d->m_informationList;
} }
KitConfigWidget *KitManager::createConfigWidget(Kit *k) const Internal::KitManagerConfigWidget *KitManager::createConfigWidget(Kit *k) const
{ {
if (!k) if (!k)
return 0; return 0;

View File

@@ -48,6 +48,7 @@ class Kit;
class KitConfigWidget; class KitConfigWidget;
namespace Internal { namespace Internal {
class KitManagerConfigWidget;
class KitManagerPrivate; class KitManagerPrivate;
class KitModel; class KitModel;
} // namespace Internal } // namespace Internal
@@ -110,7 +111,7 @@ public:
QList<KitInformation *> kitInformation() const; QList<KitInformation *> kitInformation() const;
KitConfigWidget *createConfigWidget(Kit *k) const; Internal::KitManagerConfigWidget *createConfigWidget(Kit *k) const;
public slots: public slots:
bool registerKit(ProjectExplorer::Kit *k); bool registerKit(ProjectExplorer::Kit *k);

View File

@@ -38,6 +38,7 @@
#include <QFileDialog> #include <QFileDialog>
#include <QGridLayout> #include <QGridLayout>
#include <QLabel> #include <QLabel>
#include <QLineEdit>
#include <QToolButton> #include <QToolButton>
#include <QScrollArea> #include <QScrollArea>
#include <QSizePolicy> #include <QSizePolicy>
@@ -45,43 +46,15 @@
namespace ProjectExplorer { namespace ProjectExplorer {
void KitConfigWidget::addToLayout(QGridLayout *layout, int row)
{
addLabel(layout, row);
layout->addWidget(this, row, WidgetColumn);
addButtonWidget(layout, row);
}
void KitConfigWidget::addLabel(QGridLayout *layout, int row)
{
static const Qt::Alignment alignment
= static_cast<Qt::Alignment>(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment));
QLabel *label = new QLabel(displayName());
label->setToolTip(toolTip());
layout->addWidget(label, row, LabelColumn, alignment);
}
void KitConfigWidget::addButtonWidget(QGridLayout *layout, int row)
{
if (QWidget *button = buttonWidget()) {
if (button->toolTip().isEmpty())
button->setToolTip(toolTip());
layout->addWidget(button, row, ButtonColumn);
}
}
namespace Internal { namespace Internal {
KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, QWidget *parent) : KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, QWidget *parent) :
KitConfigWidget(parent), KitConfigWidget(parent),
m_layout(new QGridLayout), m_layout(new QGridLayout),
m_iconButton(new QToolButton), m_iconButton(new QToolButton),
m_nameEdit(new QLineEdit),
m_kit(k) m_kit(k)
{ {
m_layout->setMargin(0);
m_layout->setSpacing(6);
m_layout->setContentsMargins(0, 0, 0, 0);
QVBoxLayout *top = new QVBoxLayout(this); QVBoxLayout *top = new QVBoxLayout(this);
top->setMargin(0); top->setMargin(0);
@@ -96,27 +69,25 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, QWidget *parent) :
scroll->setWidget(details); scroll->setWidget(details);
QWidget *widget = new QWidget; QWidget *widget = new QWidget;
m_layout->setMargin(0);
m_layout->setSpacing(6);
m_layout->setContentsMargins(6, 0, 6, 0);
m_layout->setRowStretch(1, 1);
widget->setLayout(m_layout);
details->setWidget(widget); details->setWidget(widget);
QVBoxLayout *iconLayout = new QVBoxLayout; addToLayout(tr("Name:"), tr("Kit name and icon."), m_nameEdit, m_iconButton);
iconLayout->addWidget(m_iconButton);
iconLayout->addStretch();
QGridLayout *masterLayout = new QGridLayout(widget);
masterLayout->setMargin(0);
masterLayout->setContentsMargins(6, 0, 6, 0);
masterLayout->addLayout(iconLayout, 0, 0);
masterLayout->addLayout(m_layout, 0, 1);
masterLayout->setRowStretch(1, 1);
discard(); discard();
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(setIcon())); connect(m_iconButton, SIGNAL(clicked()), this, SLOT(setIcon()));
connect(m_nameEdit, SIGNAL(textChanged(QString)), this, SIGNAL(dirty()));
} }
QString KitManagerConfigWidget::displayName() const QString KitManagerConfigWidget::displayName() const
{ {
return tr("Kits"); return m_nameEdit->text();
} }
void KitManagerConfigWidget::apply() void KitManagerConfigWidget::apply()
@@ -124,6 +95,7 @@ void KitManagerConfigWidget::apply()
foreach (KitConfigWidget *w, m_widgets) foreach (KitConfigWidget *w, m_widgets)
w->apply(); w->apply();
m_kit->setIconPath(m_iconPath); m_kit->setIconPath(m_iconPath);
m_kit->setDisplayName(m_nameEdit->text());
} }
void KitManagerConfigWidget::discard() void KitManagerConfigWidget::discard()
@@ -132,6 +104,7 @@ void KitManagerConfigWidget::discard()
w->discard(); w->discard();
m_iconButton->setIcon(m_kit->icon()); m_iconButton->setIcon(m_kit->icon());
m_iconPath = m_kit->iconPath(); m_iconPath = m_kit->iconPath();
m_nameEdit->setText(m_kit->displayName());
} }
bool KitManagerConfigWidget::isDirty() const bool KitManagerConfigWidget::isDirty() const
@@ -139,7 +112,7 @@ bool KitManagerConfigWidget::isDirty() const
foreach (KitConfigWidget *w, m_widgets) foreach (KitConfigWidget *w, m_widgets)
if (w->isDirty()) if (w->isDirty())
return true; return true;
return m_kit->iconPath() != m_iconPath; return (m_kit->iconPath() != m_iconPath) || (m_kit->displayName() != m_nameEdit->text());
} }
void KitManagerConfigWidget::addConfigWidget(ProjectExplorer::KitConfigWidget *widget) void KitManagerConfigWidget::addConfigWidget(ProjectExplorer::KitConfigWidget *widget)
@@ -148,7 +121,8 @@ void KitManagerConfigWidget::addConfigWidget(ProjectExplorer::KitConfigWidget *w
Q_ASSERT(!m_widgets.contains(widget)); Q_ASSERT(!m_widgets.contains(widget));
connect(widget, SIGNAL(dirty()), this, SIGNAL(dirty())); connect(widget, SIGNAL(dirty()), this, SIGNAL(dirty()));
widget->addToLayout(m_layout, m_layout->rowCount());
addToLayout(widget->displayName(), widget->toolTip(), widget, widget->buttonWidget());
m_widgets.append(widget); m_widgets.append(widget);
} }
@@ -157,11 +131,12 @@ void KitManagerConfigWidget::makeReadOnly()
foreach (KitConfigWidget *w, m_widgets) foreach (KitConfigWidget *w, m_widgets)
w->makeReadOnly(); w->makeReadOnly();
m_iconButton->setEnabled(false); m_iconButton->setEnabled(false);
m_nameEdit->setEnabled(false);
} }
void KitManagerConfigWidget::setIcon() void KitManagerConfigWidget::setIcon()
{ {
const QString path = QFileDialog::getOpenFileName(0, tr("Select Icon"), m_iconPath, tr("Images (*.png *.xpm *.jpg)")); const QString path = QFileDialog::getOpenFileName(this, tr("Select Icon"), m_iconPath, tr("Images (*.png *.xpm *.jpg)"));
if (path.isEmpty()) if (path.isEmpty())
return; return;
@@ -174,5 +149,32 @@ void KitManagerConfigWidget::setIcon()
emit dirty(); emit dirty();
} }
void KitManagerConfigWidget::addToLayout(const QString &name, const QString &toolTip,
QWidget *widget, QWidget *button)
{
int row = m_layout->rowCount();
addLabel(name, toolTip, row);
m_layout->addWidget(widget, row, WidgetColumn);
addButtonWidget(button, toolTip, row);
}
void KitManagerConfigWidget::addLabel(const QString &name, const QString &toolTip, int row)
{
static const Qt::Alignment alignment
= static_cast<Qt::Alignment>(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment));
QLabel *label = new QLabel(name);
label->setToolTip(toolTip);
m_layout->addWidget(label, row, LabelColumn, alignment);
}
void KitManagerConfigWidget::addButtonWidget(QWidget *button, const QString &toolTip, int row)
{
if (!button)
return;
if (button->toolTip().isEmpty())
button->setToolTip(toolTip);
m_layout->addWidget(button, row, ButtonColumn);
}
} // namespace Internal } // namespace Internal
} // namespace ProjectExplorer } // namespace ProjectExplorer

View File

@@ -36,6 +36,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QHBoxLayout; class QHBoxLayout;
class QGridLayout; class QGridLayout;
class QLineEdit;
class QToolButton; class QToolButton;
QT_END_NAMESPACE QT_END_NAMESPACE
@@ -63,8 +64,21 @@ private slots:
void setIcon(); void setIcon();
private: private:
enum LayoutColumns {
LabelColumn,
WidgetColumn,
ButtonColumn
};
void addToLayout(const QString &name, const QString &toolTip, QWidget *widget, QWidget *button = 0);
void addLabel(const QString &name, const QString &toolTip, int row);
void addButtonWidget(QWidget *button, const QString &toolTip, int row);
QGridLayout *m_layout; QGridLayout *m_layout;
QToolButton *m_iconButton; QToolButton *m_iconButton;
QLineEdit *m_nameEdit;
QList<KitConfigWidget *> m_widgets; QList<KitConfigWidget *> m_widgets;
Kit *m_kit; Kit *m_kit;
QString m_iconPath; QString m_iconPath;

View File

@@ -31,7 +31,7 @@
#include "kitmodel.h" #include "kitmodel.h"
#include "kit.h" #include "kit.h"
#include "kitconfigwidget.h" #include "kitmanagerconfigwidget.h"
#include "kitmanager.h" #include "kitmanager.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -72,10 +72,9 @@ public:
} }
KitNode *parent; KitNode *parent;
QString newName;
QList<KitNode *> childNodes; QList<KitNode *> childNodes;
Kit *kit; Kit *kit;
KitConfigWidget *widget; KitManagerConfigWidget *widget;
bool changed; bool changed;
}; };
@@ -173,13 +172,11 @@ QVariant KitModel::data(const QModelIndex &index, int role) const
f.setItalic(f.style() != QFont::StyleItalic); f.setItalic(f.style() != QFont::StyleItalic);
return f; return f;
} else if (role == Qt::DisplayRole) { } else if (role == Qt::DisplayRole) {
QString baseName = node->newName.isEmpty() ? node->kit->displayName() : node->newName; QString baseName = node->widget->displayName();
if (node == m_defaultNode) if (node == m_defaultNode)
//: Mark up a kit as the default one. //: Mark up a kit as the default one.
baseName = tr("%1 (default)").arg(baseName); baseName = tr("%1 (default)").arg(baseName);
return baseName; return baseName;
} else if (role == Qt::EditRole) {
return node->newName.isEmpty() ? node->kit->displayName() : node->newName;
} else if (role == Qt::DecorationRole) { } else if (role == Qt::DecorationRole) {
return node->kit->isValid() ? QIcon() : warningIcon; return node->kit->isValid() ? QIcon() : warningIcon;
} else if (role == Qt::ToolTipRole) { } else if (role == Qt::ToolTipRole) {
@@ -189,21 +186,6 @@ QVariant KitModel::data(const QModelIndex &index, int role) const
return QVariant(); return QVariant();
} }
bool KitModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
if (!index.isValid())
return false;
KitNode *node = static_cast<KitNode *>(index.internalPointer());
Q_ASSERT(node);
if (index.column() != 0 || !node->kit || role != Qt::EditRole)
return false;
node->newName = value.toString();
if (!node->newName.isEmpty() && node->newName != node->kit->displayName())
node->changed = true;
return true;
}
Qt::ItemFlags KitModel::flags(const QModelIndex &index) const Qt::ItemFlags KitModel::flags(const QModelIndex &index) const
{ {
if (!index.isValid()) if (!index.isValid())
@@ -214,10 +196,7 @@ Qt::ItemFlags KitModel::flags(const QModelIndex &index) const
if (!node->kit) if (!node->kit)
return Qt::ItemIsEnabled; return Qt::ItemIsEnabled;
if (node->kit->isAutoDetected())
return Qt::ItemIsEnabled | Qt::ItemIsSelectable; return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
} }
QVariant KitModel::headerData(int section, Qt::Orientation orientation, int role) const QVariant KitModel::headerData(int section, Qt::Orientation orientation, int role) const
@@ -309,10 +288,6 @@ void KitModel::apply()
Q_ASSERT(n->kit); Q_ASSERT(n->kit);
if (n->changed) { if (n->changed) {
KitManager::instance()->blockSignals(true); KitManager::instance()->blockSignals(true);
if (!n->newName.isEmpty()) {
n->kit->setDisplayName(n->newName);
n->newName.clear();
}
if (n->widget) if (n->widget)
n->widget->apply(); n->widget->apply();
n->changed = false; n->changed = false;

View File

@@ -69,7 +69,6 @@ public:
int columnCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
Qt::ItemFlags flags(const QModelIndex &index) const; Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;

View File

@@ -153,13 +153,7 @@ void Project::addTarget(Target *t)
QTC_ASSERT(!target(t->kit()), return); QTC_ASSERT(!target(t->kit()), return);
Q_ASSERT(t->project() == this); Q_ASSERT(t->project() == this);
// Check that we don't have a configuration with the same displayName t->setDefaultDisplayName(t->displayName());
QString targetDisplayName = t->displayName();
QStringList displayNames;
foreach (const Target *target, d->m_targets)
displayNames << target->displayName();
targetDisplayName = makeUnique(targetDisplayName, displayNames);
t->setDefaultDisplayName(targetDisplayName);
// add it // add it
d->m_targets.push_back(t); d->m_targets.push_back(t);
@@ -243,9 +237,10 @@ Target *Project::target(Kit *k) const
return 0; return 0;
} }
bool Project::supportsKit(Kit *k) const bool Project::supportsKit(Kit *k, QString *errorMessage) const
{ {
Q_UNUSED(k); Q_UNUSED(k);
Q_UNUSED(errorMessage);
return true; return true;
} }

View File

@@ -90,7 +90,7 @@ public:
void setActiveTarget(Target *target); void setActiveTarget(Target *target);
Target *target(const Core::Id id) const; Target *target(const Core::Id id) const;
Target *target(Kit *k) const; Target *target(Kit *k) const;
virtual bool supportsKit(Kit *k) const; virtual bool supportsKit(Kit *k, QString *errorMessage = 0) const;
Target *createTarget(Kit *k); Target *createTarget(Kit *k);
Target *restoreTarget(const QVariantMap &data); Target *restoreTarget(const QVariantMap &data);

View File

@@ -704,22 +704,20 @@ QVariantMap SettingsAccessor::restoreSettings() const
for (int i = sharedSettings.m_version; i < baseFileVersion; ++i) for (int i = sharedSettings.m_version; i < baseFileVersion; ++i)
sharedSettings.m_map = m_handlers.value(i)->update(m_project, sharedSettings.m_map); sharedSettings.m_map = m_handlers.value(i)->update(m_project, sharedSettings.m_map);
if (!settings.isValid()) { if (settings.isValid()) {
m_project->setProperty(SHARED_SETTINGS, sharedSettings.m_map);
return sharedSettings.m_map;
}
for (int i = settings.m_version; i < baseFileVersion; ++i) for (int i = settings.m_version; i < baseFileVersion; ++i)
settings.m_map = m_handlers.value(i)->update(m_project, settings.m_map); settings.m_map = m_handlers.value(i)->update(m_project, settings.m_map);
settings.m_version = baseFileVersion; settings.m_version = baseFileVersion;
} }
} }
}
if (useSharedSettings) { if (useSharedSettings) {
m_project->setProperty(SHARED_SETTINGS, sharedSettings.m_map); m_project->setProperty(SHARED_SETTINGS, sharedSettings.m_map);
if (!settings.isValid()) if (settings.isValid())
return sharedSettings.m_map;
mergeSharedSettings(&settings.m_map, sharedSettings.m_map); mergeSharedSettings(&settings.m_map, sharedSettings.m_map);
else
settings = sharedSettings;
} }
} }

View File

@@ -55,6 +55,7 @@
#include <QStackedWidget> #include <QStackedWidget>
#include <QToolTip> #include <QToolTip>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QToolTip>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal; using namespace ProjectExplorer::Internal;
@@ -68,7 +69,8 @@ TargetSettingsPanelWidget::TargetSettingsPanelWidget(Project *project) :
m_currentTarget(0), m_currentTarget(0),
m_project(project), m_project(project),
m_selector(0), m_selector(0),
m_centralWidget(0) m_centralWidget(0),
m_lastAction(0)
{ {
Q_ASSERT(m_project); Q_ASSERT(m_project);
@@ -97,6 +99,33 @@ TargetSettingsPanelWidget::~TargetSettingsPanelWidget()
{ {
} }
bool TargetSettingsPanelWidget::event(QEvent *event)
{
if (event->type() == QEvent::StatusTip) {
QStatusTipEvent *ev = static_cast<QStatusTipEvent *>(event);
ev->accept();
QAction *act = m_addMenu->activeAction();
if (act != m_lastAction)
QToolTip::showText(QPoint(), QString());
m_lastAction = act;
if (act) {
QRect actionRect = m_addMenu->actionGeometry(act);
actionRect.translate(m_addMenu->pos());
QPoint p = QCursor::pos();
if (!actionRect.contains(p))
p = actionRect.center();
p.setY(actionRect.center().y());
QToolTip::showText(p, ev->tip(), m_addMenu, m_addMenu->actionGeometry(act));
} else {
QToolTip::showText(QPoint(), QString());
}
return true;
}
return QWidget::event(event);
}
void TargetSettingsPanelWidget::setupUi() void TargetSettingsPanelWidget::setupUi()
{ {
QVBoxLayout *viewLayout = new QVBoxLayout(this); QVBoxLayout *viewLayout = new QVBoxLayout(this);
@@ -315,11 +344,14 @@ void TargetSettingsPanelWidget::updateTargetAddAndRemoveButtons()
foreach (Kit *k, KitManager::instance()->kits()) { foreach (Kit *k, KitManager::instance()->kits()) {
if (m_project->target(k)) if (m_project->target(k))
continue; continue;
if (!m_project->supportsKit(k))
continue;
QAction *action = new QAction(k->displayName(), m_addMenu); QAction *action = new QAction(k->displayName(), m_addMenu);
action->setData(QVariant::fromValue(k->id())); action->setData(QVariant::fromValue(k->id()));
QString errorMessage;
if (!m_project->supportsKit(k, &errorMessage)) {
action->setEnabled(false);
action->setStatusTip(errorMessage);
}
bool inserted = false; bool inserted = false;
foreach (QAction *existing, m_addMenu->actions()) { foreach (QAction *existing, m_addMenu->actions()) {

View File

@@ -61,6 +61,8 @@ public:
int currentSubIndex() const; int currentSubIndex() const;
void setCurrentSubIndex(int subIndex); void setCurrentSubIndex(int subIndex);
protected:
bool event(QEvent *event);
private slots: private slots:
void currentTargetChanged(int targetIndex, int subIndex); void currentTargetChanged(int targetIndex, int subIndex);
void removeTarget(int targetIndex); void removeTarget(int targetIndex);
@@ -82,6 +84,7 @@ private:
PanelsWidget *m_panelWidgets[2]; PanelsWidget *m_panelWidgets[2];
QList<Target *> m_targets; QList<Target *> m_targets;
QMenu *m_addMenu; QMenu *m_addMenu;
QAction *m_lastAction;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -360,7 +360,7 @@ QModelIndex TaskFilterModel::index(int row, int column, const QModelIndex &paren
{ {
if (parent.isValid()) if (parent.isValid())
return QModelIndex(); return QModelIndex();
return createIndex(row, column, 0); return createIndex(row, column);
} }
QModelIndex TaskFilterModel::parent(const QModelIndex &child) const QModelIndex TaskFilterModel::parent(const QModelIndex &child) const

View File

@@ -2,6 +2,6 @@ macx {
DESTDIR = $$IDE_LIBRARY_PATH/QmlDesigner DESTDIR = $$IDE_LIBRARY_PATH/QmlDesigner
} else { } else {
DESTDIR = $$IDE_LIBRARY_PATH/qmldesigner DESTDIR = $$IDE_LIBRARY_PATH/qmldesigner
target.path = /$$IDE_LIBRARY_BASENAME/qtcreator/qmldesigner target.path = $$QTC_PREFIX/$$IDE_LIBRARY_BASENAME/qtcreator/qmldesigner
INSTALLS += target INSTALLS += target
} }

View File

@@ -269,14 +269,19 @@ ProjectExplorer::IProjectManager *QmlProject::projectManager() const
return m_manager; return m_manager;
} }
bool QmlProject::supportsKit(ProjectExplorer::Kit *k) const bool QmlProject::supportsKit(ProjectExplorer::Kit *k, QString *errorMessage) const
{ {
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k); Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k);
if (deviceType != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) if (deviceType != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
if (errorMessage)
*errorMessage = tr("Device type is not desktop.");
return false; return false;
}
// TODO: Limit supported versions? // TODO: Limit supported versions?
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k); QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k);
if (!version && errorMessage)
*errorMessage = tr("No Qt version set in kit.");
return version; return version;
} }

View File

@@ -66,7 +66,7 @@ public:
Core::IDocument *document() const; Core::IDocument *document() const;
ProjectExplorer::IProjectManager *projectManager() const; ProjectExplorer::IProjectManager *projectManager() const;
bool supportsKit(ProjectExplorer::Kit *k) const; bool supportsKit(ProjectExplorer::Kit *k, QString *errorMessage) const;
QList<ProjectExplorer::BuildConfigWidget*> subConfigWidgets(); QList<ProjectExplorer::BuildConfigWidget*> subConfigWidgets();

View File

@@ -864,9 +864,11 @@ Qt4Manager *Qt4Project::qt4ProjectManager() const
return m_manager; return m_manager;
} }
bool Qt4Project::supportsKit(Kit *k) const bool Qt4Project::supportsKit(Kit *k, QString *errorMessage) const
{ {
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k); QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k);
if (!version && errorMessage)
*errorMessage = tr("No Qt version set in kit.");
return version; return version;
} }

View File

@@ -83,7 +83,7 @@ public:
ProjectExplorer::IProjectManager *projectManager() const; ProjectExplorer::IProjectManager *projectManager() const;
Qt4Manager *qt4ProjectManager() const; Qt4Manager *qt4ProjectManager() const;
bool supportsKit(ProjectExplorer::Kit *k) const; bool supportsKit(ProjectExplorer::Kit *k, QString *errorMesage) const;
ProjectExplorer::ProjectNode *rootProjectNode() const; ProjectExplorer::ProjectNode *rootProjectNode() const;
Qt4ProFileNode *rootQt4ProjectNode() const; Qt4ProFileNode *rootQt4ProjectNode() const;

View File

@@ -119,7 +119,7 @@ Qt4TargetSetupWidget::Qt4TargetSetupWidget(ProjectExplorer::Kit *k,
Qt4TargetSetupWidget::~Qt4TargetSetupWidget() Qt4TargetSetupWidget::~Qt4TargetSetupWidget()
{ } { }
ProjectExplorer::Kit *Qt4TargetSetupWidget::profile() ProjectExplorer::Kit *Qt4TargetSetupWidget::kit()
{ {
return m_kit; return m_kit;
} }

View File

@@ -67,7 +67,7 @@ public:
const QList<BuildConfigurationInfo> &infoList); const QList<BuildConfigurationInfo> &infoList);
~Qt4TargetSetupWidget(); ~Qt4TargetSetupWidget();
ProjectExplorer::Kit *profile(); ProjectExplorer::Kit *kit();
void clearKit(); void clearKit();
bool isKitSelected() const; bool isKitSelected() const;

View File

@@ -63,6 +63,8 @@ namespace Internal {
static const Core::Id QT_IS_TEMPORARY("Qt4PM.TempQt"); static const Core::Id QT_IS_TEMPORARY("Qt4PM.TempQt");
static const Core::Id KIT_IS_TEMPORARY("Qt4PM.TempKit"); static const Core::Id KIT_IS_TEMPORARY("Qt4PM.TempKit");
static const Core::Id KIT_TEMPORARY_NAME("Qt4PM.TempName");
static const Core::Id KIT_FINAL_NAME("Qt4PM.FinalName");
static const Core::Id TEMPORARY_OF_PROJECTS("Qt4PM.TempProject"); static const Core::Id TEMPORARY_OF_PROJECTS("Qt4PM.TempProject");
class TargetSetupPageUi class TargetSetupPageUi
@@ -276,7 +278,7 @@ void TargetSetupPage::setupWidgets()
void TargetSetupPage::reset() void TargetSetupPage::reset()
{ {
foreach (Qt4TargetSetupWidget *widget, m_widgets.values()) { foreach (Qt4TargetSetupWidget *widget, m_widgets.values()) {
ProjectExplorer::Kit *k = widget->profile(); ProjectExplorer::Kit *k = widget->kit();
if (!k) if (!k)
continue; continue;
removeProject(k, m_proFilePath); removeProject(k, m_proFilePath);
@@ -296,9 +298,10 @@ ProjectExplorer::Kit *TargetSetupPage::createTemporaryKit(QtSupport::BaseQtVersi
ProjectExplorer::ToolChainKitInformation::setToolChain(k, version->preferredToolChain(parsedSpec)); ProjectExplorer::ToolChainKitInformation::setToolChain(k, version->preferredToolChain(parsedSpec));
QmakeKitInformation::setMkspec(k, parsedSpec); QmakeKitInformation::setMkspec(k, parsedSpec);
k->setDisplayName(version->displayName()); k->setDisplayName(tr("%1 - temporary").arg(version->displayName()));
k->setValue(KIT_TEMPORARY_NAME, k->displayName());
k->setValue(KIT_FINAL_NAME, version->displayName());
k->setValue(KIT_IS_TEMPORARY, true); k->setValue(KIT_IS_TEMPORARY, true);
k->setValue(TEMPORARY_OF_PROJECTS, QStringList() << m_proFilePath);
if (temporaryVersion) if (temporaryVersion)
k->setValue(QT_IS_TEMPORARY, version->uniqueId()); k->setValue(QT_IS_TEMPORARY, version->uniqueId());
@@ -315,6 +318,11 @@ void TargetSetupPage::cleanKit(ProjectExplorer::Kit *k)
k->removeKey(KIT_IS_TEMPORARY); k->removeKey(KIT_IS_TEMPORARY);
k->removeKey(QT_IS_TEMPORARY); k->removeKey(QT_IS_TEMPORARY);
k->removeKey(TEMPORARY_OF_PROJECTS); k->removeKey(TEMPORARY_OF_PROJECTS);
const QString tempName = k->value(KIT_TEMPORARY_NAME).toString();
if (!tempName.isNull() && k->displayName() == tempName)
k->setDisplayName(k->value(KIT_FINAL_NAME).toString());
k->removeKey(KIT_TEMPORARY_NAME);
k->removeKey(KIT_FINAL_NAME);
m_ignoreUpdates = false; m_ignoreUpdates = false;
} }
@@ -395,7 +403,6 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
QtSupport::BaseQtVersion *version = 0; QtSupport::BaseQtVersion *version = 0;
bool temporaryVersion = false; bool temporaryVersion = false;
ProjectExplorer::Kit *kit = 0;
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance(); QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
ProjectExplorer::KitManager *km = ProjectExplorer::KitManager::instance(); ProjectExplorer::KitManager *km = ProjectExplorer::KitManager::instance();
@@ -438,7 +445,8 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
specArgument = QLatin1String("-spec ") + Utils::QtcProcess::quoteArg(parsedSpec.toUserOutput()); specArgument = QLatin1String("-spec ") + Utils::QtcProcess::quoteArg(parsedSpec.toUserOutput());
Utils::QtcProcess::addArgs(&specArgument, additionalArguments); Utils::QtcProcess::addArgs(&specArgument, additionalArguments);
// Find profile: // Find profiles (can be more than one, e.g. (Linux-)Desktop and embedded linux):
QList<ProjectExplorer::Kit *> kitList;
foreach (ProjectExplorer::Kit *k, km->kits()) { foreach (ProjectExplorer::Kit *k, km->kits()) {
QtSupport::BaseQtVersion *profileVersion = QtSupport::QtKitInformation::qtVersion(k); QtSupport::BaseQtVersion *profileVersion = QtSupport::QtKitInformation::qtVersion(k);
Utils::FileName profileSpec = QmakeKitInformation::mkspec(k); Utils::FileName profileSpec = QmakeKitInformation::mkspec(k);
@@ -448,18 +456,19 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
if (profileVersion == version if (profileVersion == version
&& profileSpec == parsedSpec) && profileSpec == parsedSpec)
kit = k; kitList.append(k);
} }
if (!kit) if (kitList.isEmpty())
kit = createTemporaryKit(version, temporaryVersion, parsedSpec); kitList.append(createTemporaryKit(version, temporaryVersion, parsedSpec));
else
addProject(kit, m_proFilePath); foreach (ProjectExplorer::Kit *k, kitList) {
addProject(k, m_proFilePath);
// Create widget: // Create widget:
Qt4TargetSetupWidget *widget = m_widgets.value(kit->id(), 0); Qt4TargetSetupWidget *widget = m_widgets.value(k->id(), 0);
if (!widget) if (!widget)
addWidget(kit); addWidget(k);
widget = m_widgets.value(kit->id(), 0); widget = m_widgets.value(k->id(), 0);
if (!widget) if (!widget)
continue; continue;
@@ -474,6 +483,7 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
widget->setKitSelected(true); widget->setKitSelected(true);
found = true; found = true;
} }
}
updateVisibility(); updateVisibility();
@@ -660,7 +670,7 @@ bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project)
if (!widget->isKitSelected()) if (!widget->isKitSelected())
continue; continue;
ProjectExplorer::Kit *k = widget->profile(); ProjectExplorer::Kit *k = widget->kit();
cleanKit(k); cleanKit(k);
toRegister.append(KitBuildInfo(k, widget->selectedBuildConfigurationInfoList())); toRegister.append(KitBuildInfo(k, widget->selectedBuildConfigurationInfoList()));
widget->clearKit(); widget->clearKit();

View File

@@ -349,7 +349,8 @@ void BaseQtVersion::fromMap(const QVariantMap &map)
QString string = map.value(QLatin1String(QTVERSIONQMAKEPATH)).toString(); QString string = map.value(QLatin1String(QTVERSIONQMAKEPATH)).toString();
if (string.startsWith(QLatin1Char('~'))) if (string.startsWith(QLatin1Char('~')))
string.remove(0, 1).prepend(QDir::homePath()); string.remove(0, 1).prepend(QDir::homePath());
ctor(FileName::fromUserInput(string)); const QString canonical = QFileInfo(string).canonicalFilePath();
ctor(FileName::fromString(canonical.isEmpty() ? string : canonical));
} }
QVariantMap BaseQtVersion::toMap() const QVariantMap BaseQtVersion::toMap() const
@@ -792,16 +793,19 @@ FileName BaseQtVersion::mkspec() const
FileName BaseQtVersion::mkspecFor(ProjectExplorer::ToolChain *tc) const FileName BaseQtVersion::mkspecFor(ProjectExplorer::ToolChain *tc) const
{ {
Utils::FileName versionSpec = mkspec();
if (!tc) if (!tc)
return mkspec(); return versionSpec;
const QList<FileName> tcSpecList = tc->suggestedMkspecList(); const QList<FileName> tcSpecList = tc->suggestedMkspecList();
if (tcSpecList.contains(versionSpec))
return versionSpec;
foreach (const FileName &tcSpec, tcSpecList) { foreach (const FileName &tcSpec, tcSpecList) {
if (hasMkspec(tcSpec)) if (hasMkspec(tcSpec))
return tcSpec; return tcSpec;
} }
return mkspec(); return versionSpec;
} }
FileName BaseQtVersion::mkspecPath() const FileName BaseQtVersion::mkspecPath() const
@@ -1195,11 +1199,16 @@ bool BaseQtVersion::queryQMakeVariables(const FileName &binary, QHash<QString, Q
Environment env = Environment::systemEnvironment(); Environment env = Environment::systemEnvironment();
if (HostOsInfo::isWindowsHost()) { if (HostOsInfo::isWindowsHost()) {
// Add tool chain environments. This is necessary for non-static qmakes e.g. using mingw on windows // Add tool chain environment. This is necessary for non-static qmakes e.g. using mingw on windows
// We can not just add all the environments of all tool chains since that will make PATH too long
// which in turn will trigger a crash when parsing the results of vcvars.bat of MSVC.
QList<ProjectExplorer::Abi> abiList = ProjectExplorer::Abi::abisOfBinary(binary);
QList<ProjectExplorer::ToolChain *> tcList = ProjectExplorer::ToolChainManager::instance()->toolChains(); QList<ProjectExplorer::ToolChain *> tcList = ProjectExplorer::ToolChainManager::instance()->toolChains();
foreach (ProjectExplorer::ToolChain *tc, tcList) foreach (ProjectExplorer::ToolChain *tc, tcList) {
if (abiList.contains(tc->targetAbi()))
tc->addToEnvironment(env); tc->addToEnvironment(env);
} }
}
process.setEnvironment(env.toStringList()); process.setEnvironment(env.toStringList());
process.start(qmake.absoluteFilePath(), QStringList(QLatin1String("-query")), QIODevice::ReadOnly); process.start(qmake.absoluteFilePath(), QStringList(QLatin1String("-query")), QIODevice::ReadOnly);

View File

@@ -31,6 +31,7 @@
#include "qtkitinformation.h" #include "qtkitinformation.h"
#include "qtkitconfigwidget.h" #include "qtkitconfigwidget.h"
#include "qtsupportconstants.h"
#include "qtversionmanager.h" #include "qtversionmanager.h"
#include <utils/environment.h> #include <utils/environment.h>
@@ -71,10 +72,15 @@ QVariant QtKitInformation::defaultValue(ProjectExplorer::Kit *k) const
return -1; return -1;
QList<BaseQtVersion *> versionList = mgr->versions(); QList<BaseQtVersion *> versionList = mgr->versions();
BaseQtVersion *fallBack = 0;
foreach (BaseQtVersion *v, versionList) { foreach (BaseQtVersion *v, versionList) {
if (qmake == v->qmakeCommand()) if (qmake == v->qmakeCommand())
return v->uniqueId(); return v->uniqueId();
if (v->type() == QLatin1String(QtSupport::Constants::DESKTOPQT) && !fallBack)
fallBack = v;
} }
if (fallBack)
return fallBack->uniqueId();
return -1; return -1;
} }

View File

@@ -634,19 +634,24 @@ static QString filterForQmakeFileDialog()
void QtOptionsPageWidget::addQtDir() void QtOptionsPageWidget::addQtDir()
{ {
Utils::FileName qtVersion = Utils::FileName::fromString( Utils::FileName qtVersion = Utils::FileName::fromString(
QFileDialog::getOpenFileName(this, QFileInfo(QFileDialog::getOpenFileName(this,
tr("Select a qmake executable"), tr("Select a qmake executable"),
QString(), QString(),
filterForQmakeFileDialog(), filterForQmakeFileDialog(),
0, 0,
QFileDialog::DontResolveSymlinks)); QFileDialog::DontResolveSymlinks)).canonicalFilePath());
if (qtVersion.isNull()) if (qtVersion.isNull())
return; return;
if (QtVersionManager::instance()->qtVersionForQMakeBinary(qtVersion)) { BaseQtVersion *version = QtVersionManager::instance()->qtVersionForQMakeBinary(qtVersion);
if (version) {
// Already exist // Already exist
QMessageBox::warning(this, tr("Qt known"),
tr("This Qt version was already registered as \"%1\".")
.arg(version->displayName()));
return;
} }
BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qtVersion); version = QtVersionFactory::createQtVersionFromQMakePath(qtVersion);
if (version) { if (version) {
m_versions.append(version); m_versions.append(version);

View File

@@ -623,9 +623,8 @@ Utils::FileName QtVersionManager::findQMakeBinaryFromMakefile(const QString &mak
#endif #endif
// Is qmake still installed? // Is qmake still installed?
QFileInfo fi(qmakePath); QFileInfo fi(qmakePath);
if (fi.exists()) { if (fi.exists())
return Utils::FileName(fi); return Utils::FileName::fromString(fi.canonicalFilePath());
}
} }
} }
} }

View File

@@ -291,6 +291,6 @@ void CodeStylePool::exportCodeStyle(const Utils::FileName &fileName, ICodeStyleP
tmp.insert(QLatin1String(displayNameKey), codeStyle->displayName()); tmp.insert(QLatin1String(displayNameKey), codeStyle->displayName());
tmp.insert(QLatin1String(codeStyleDataKey), map); tmp.insert(QLatin1String(codeStyleDataKey), map);
Utils::PersistentSettingsWriter writer(fileName, QLatin1String(codeStyleDocKey)); Utils::PersistentSettingsWriter writer(fileName, QLatin1String(codeStyleDocKey));
writer.save(map, 0); writer.save(tmp, 0);
} }

View File

@@ -270,7 +270,7 @@ With cache simulation, further event counters are enabled:
<string/> <string/>
</property> </property>
<property name="text"> <property name="text">
<string>Visualisation: Minimum event cost:</string> <string>Visualization: Minimum event cost:</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -87,7 +87,7 @@ QModelIndex ErrorListModel::index(int row, int column, const QModelIndex &parent
QTC_ASSERT(parent.model() == this, qt_noop()); QTC_ASSERT(parent.model() == this, qt_noop());
return QModelIndex(); return QModelIndex();
} }
return createIndex(row, column, 0); return createIndex(row, column);
} }
QModelIndex ErrorListModel::parent(const QModelIndex &child) const QModelIndex ErrorListModel::parent(const QModelIndex &child) const

View File

@@ -192,7 +192,7 @@ QModelIndex StackModel::parent(const QModelIndex &child) const
{ {
QTC_ASSERT(!child.isValid() || child.model() == this, return QModelIndex()); QTC_ASSERT(!child.isValid() || child.model() == this, return QModelIndex());
if (child.internalId() == -1) if (quintptr(child.internalId()) == quintptr(-1))
return QModelIndex(); return QModelIndex();
return createIndex(child.internalId(), 0, -1); return createIndex(child.internalId(), 0, -1);
} }

View File

@@ -19,9 +19,9 @@ contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
!macx { !macx {
win32 { win32 {
target.path = /bin target.path = $$QTC_PREFIX/bin
} else { } else {
target.path = /$$IDE_LIBRARY_BASENAME/qtcreator target.path = $$QTC_PREFIX/$$IDE_LIBRARY_BASENAME/qtcreator
} }
INSTALLS += target INSTALLS += target
} }

View File

@@ -109,9 +109,9 @@ CONFIG += plugin plugin_with_soname
linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
!macx { !macx {
target.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER target.path = $$QTC_PREFIX/$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER
pluginspec.files += $${TARGET}.pluginspec pluginspec.files += $${TARGET}.pluginspec
pluginspec.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER pluginspec.path = $$QTC_PREFIX/$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER
INSTALLS += target pluginspec INSTALLS += target pluginspec
} }

View File

@@ -6,7 +6,7 @@ SOURCES += main.cpp
DESTDIR=../../../bin DESTDIR=../../../bin
target.path=/bin target.path=$$QTC_PREFIX/bin
INSTALLS+=target INSTALLS+=target
include(../../../qtcreator.pri) include(../../../qtcreator.pri)

Some files were not shown because too many files have changed in this diff Show More