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
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
====================
Prerequisites:
* Qt 4.7.4
* Qt 4.8.0
* On Windows:
- ActiveState Active Perl
- 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
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
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

View File

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

View File

@@ -435,7 +435,7 @@
\o Use \c{class} instead of \c{struct}. Some compilers mangle that
difference into the symbol names and spit out warnings if a struct
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
@@ -782,7 +782,7 @@
reentrant, though.
\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:
\code
@@ -848,7 +848,7 @@
\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
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.
\o Do not hide virtual methods in subclasses (\{-Woverloaded-virtual}).

View File

@@ -78,12 +78,12 @@ dev_qch_docs.depends += dev_html_docs
!macx {
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
INSTALLS += inst_qch_docs
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
INSTALLS += inst_dev_qch_docs

View File

@@ -102,7 +102,7 @@
\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
debugging helper library.

View File

@@ -193,7 +193,7 @@
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
and stepping throught the code easier.
and stepping through the code easier.
You can specify breakpoints before or after attaching the
debugger to the application.

View File

@@ -1652,7 +1652,7 @@
\row
\o Switch with Next/Previous Parameter
\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
\o Extract Method
\o Moves the selected code to a new method and replaces the block of

View File

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

View File

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

View File

@@ -245,7 +245,7 @@
\section3 Reverting Changes Using Git
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
index.

View File

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

View File

@@ -509,7 +509,7 @@
\endcode
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
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

View File

@@ -53,7 +53,7 @@ Column {
* [bool=true] Specifies the grouping behavior. If enabled, the checked property on buttons contained
* 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

View File

@@ -53,7 +53,7 @@ Row {
* [bool=true] Specifies the grouping behavior. If enabled, the checked property on buttons contained
* 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

View File

@@ -37,7 +37,7 @@ MouseArea {
// 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
// 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
// opacity to 1 or 0, respectively.

View File

@@ -52,6 +52,6 @@ DATA_FILE_PATTERNS = \
!macx {
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
}

View File

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

View File

@@ -26,19 +26,23 @@ macx {
dmg.depends = deployqt
QMAKE_EXTRA_TARGETS += codesign dmg
} else {
deployqt.commands = $$PWD/scripts/deployqt.py -i $(INSTALL_ROOT)
deployqt.commands = $$PWD/scripts/deployqt.py -i \"$(INSTALL_ROOT)$$QTC_PREFIX\"
deployqt.depends = install
win32 {
bindist.commands ~= s,/,\\\\,g
deployqt.commands ~= s,/,\\\\,g
deployartifacts.depends = install
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
}
else:linux-*:PLATFORM="linux-$${QT_ARCH}"
else:PLATFORM="unknown"
bindist.commands = $$PWD/scripts/bindistHelper.py "$(INSTALL_ROOT)" "$${PLATFORM}$(INSTALL_EDITION)-$${QTCREATOR_VERSION}$(INSTALL_POSTFIX)"
else:linux-*: PLATFORM = "linux-$${QT_ARCH}"
else:PLATFORM = "unknown"
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

View File

@@ -12,6 +12,7 @@ Project {
references: [
"lib/qtcreator/qtcomponents/qtcomponents.qbs",
"share/share.qbs",
"share/qtcreator/translations/translations.qbs",
"src/libs/3rdparty/botan/botan.qbs",
"src/libs/aggregation/aggregation.qbs",
"src/libs/cplusplus/cplusplus.qbs",
@@ -79,7 +80,8 @@ Project {
"src/tools/qtcdebugger/qtcdebugger.qbs",
"src/tools/qtcreatorcrashhandler/qtcreatorcrashhandler.qbs",
"src/tools/qtpromaker/qtpromaker.qbs",
"src/plugins/cpaster/frontend/frontend.qbs"
"src/plugins/cpaster/frontend/frontend.qbs",
"src/tools/sdktool/sdktool.qbs"
]
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)
{
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("numchild", "0");
#if 1

View File

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

View File

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

View File

@@ -63,7 +63,7 @@ OTHER_FILES += $$FILES
!macx {
for(data_dir, DATA_DIRS) {
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
}
} else {
@@ -116,7 +116,7 @@ QMAKE_EXTRA_COMPILERS += unconditionalCopy2build
!macx {
for(data_dir, DATA_DIRS) {
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)
INSTALLS += $$data_dir
}

View File

@@ -120,6 +120,6 @@ isEmpty(vcproj) {
}
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
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"
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
onClicked: gettingStarted.openHelp("qthelp://com.nokia.qtcreator/doc/creator-overview.html")
@@ -114,7 +114,7 @@ Rectangle {
x: 250
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")
imageUrl: "widgets/images/gettingStarted02.png"
number: 2

View File

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

View File

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

View File

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

View File

@@ -82,6 +82,6 @@ HEADERS += extensioncontext.h \
knowntype.h \
symbolgroupnode.h
target.path = /lib/$${DIRNAME}
target.path = $$QTC_PREFIX/lib/$${DIRNAME}
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.]*)"),
Qt::CaseInsensitive);
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\\.]*)"),
Qt::CaseInsensitive);
regexp2.indexIn(output);

View File

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

View File

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

View File

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

View File

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

View File

@@ -213,7 +213,9 @@ QtcLibrary {
}
ProductModule {
Depends { name: "cpp" }
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())
return QModelIndex();
else
return createIndex(row, column, 0);
return createIndex(row, column);
}
QModelIndex BookmarkManager::parent(const QModelIndex &) const

View File

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

View File

@@ -31,8 +31,8 @@
**************************************************************************/
#include "checkoutdialog.h"
#include "clearcaseplugin.h"
#include "ui_checkoutdialog.h"
#include "activityselector.h"
#include <QList>
#include <QPair>
@@ -41,11 +41,23 @@
namespace ClearCase {
namespace Internal {
CheckOutDialog::CheckOutDialog(const QString &fileName, QWidget *parent) :
QDialog(parent), ui(new Ui::CheckOutDialog)
CheckOutDialog::CheckOutDialog(const QString &fileName, bool isUcm, QWidget *parent) :
QDialog(parent), ui(new Ui::CheckOutDialog), m_actSelector(0)
{
ui->setupUi(this);
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()
@@ -55,7 +67,7 @@ CheckOutDialog::~CheckOutDialog()
QString CheckOutDialog::activity() const
{
return ui->actSelector->activity();
return m_actSelector ? m_actSelector->activity() : QString();
}
QString CheckOutDialog::comment() const

View File

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

View File

@@ -21,16 +21,6 @@
</property>
</widget>
</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>
<widget class="QLabel" name="lblComment">
<property name="text">
@@ -110,14 +100,6 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ActivitySelector</class>
<extends>QWidget</extends>
<header>activityselector.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>

View File

@@ -85,18 +85,20 @@
#include <QMenu>
#include <QMessageBox>
#include <QMutex>
#include <QProcess>
#include <QRegExp>
#include <QSharedPointer>
#include <QtConcurrentRun>
#include <QTemporaryFile>
#include <QTextCodec>
#include <QProcess>
#include <QSharedPointer>
#include <QTimer>
#include <QtPlugin>
#include <QUrl>
#include <QUuid>
#include <QVariant>
#include <QVBoxLayout>
#include <QXmlStreamReader>
#include <QtConcurrentRun>
#include <QtPlugin>
namespace ClearCase {
namespace Internal {
@@ -161,6 +163,8 @@ ClearCasePlugin *ClearCasePlugin::m_clearcasePluginInstance = 0;
ClearCasePlugin::ClearCasePlugin() :
VcsBase::VcsBasePlugin(QLatin1String(ClearCase::Constants::CLEARCASECHECKINEDITOR_ID)),
m_isDynamic(false),
m_isUcm(false),
m_commandLocator(0),
m_checkOutAction(0),
m_checkInCurrentAction(0),
@@ -211,6 +215,14 @@ bool ClearCasePlugin::isCheckInEditorOpen() const
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
{
// Snapshot view
@@ -218,6 +230,7 @@ QString ClearCasePlugin::findTopLevel(const QString &directory) const
findRepositoryForDirectory(directory, QLatin1String(ClearCase::Constants::CLEARCASE_ROOT_FILE));
if (!topLevel.isEmpty() || !clearCaseControl()->isConfigured())
return topLevel;
// Dynamic view
if (directory.startsWith(m_topLevel) && directory.at(m_topLevel.size()) == QLatin1Char('/'))
return m_topLevel;
@@ -554,7 +567,7 @@ QString ClearCasePlugin::ccGetFileActivity(const QString &workingDir, const QStr
return response.stdOut;
}
ClearCaseSubmitEditor *ClearCasePlugin::openClearCaseSubmitEditor(const QString &fileName)
ClearCaseSubmitEditor *ClearCasePlugin::openClearCaseSubmitEditor(const QString &fileName, bool isUcm)
{
Core::IEditor *editor =
Core::EditorManager::openEditor(fileName,
@@ -565,18 +578,28 @@ ClearCaseSubmitEditor *ClearCasePlugin::openClearCaseSubmitEditor(const QString
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_checkInSelectedAction, m_checkInDiffAction);
connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(diffCheckInFiles(QStringList)));
submitEditor->setCheckScriptWorkingDirectory(m_checkInView);
submitEditor->setIsUcm(isUcm);
return submitEditor;
}
void ClearCasePlugin::updateStatusActions()
{
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_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_addFileAction->setEnabled(hasFile && (fileStatus.status & FileStatus::NotManaged));
m_checkInActivityAction->setEnabled(m_isUcm);
m_diffActivityAction->setEnabled(m_isUcm);
}
void ClearCasePlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
@@ -591,7 +614,7 @@ void ClearCasePlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
if (hasTopLevel)
m_topLevel = state.topLevel();
m_updateViewAction->setParameter(m_view);
m_updateViewAction->setParameter(m_isDynamic ? QString() : m_view);
const QString fileName = state.currentFileName();
m_checkOutAction->setParameter(fileName);
@@ -679,6 +702,12 @@ bool ClearCasePlugin::vcsUndoCheckOut(const QString &workingDir, const QString &
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)
{
if (ClearCase::Constants::debug)
@@ -913,8 +942,11 @@ void ClearCasePlugin::startCheckInAll()
void ClearCasePlugin::startCheckInActivity()
{
QTC_ASSERT(isUcm(), return);
const VcsBase::VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return);
QDialog dlg;
QVBoxLayout *layout = new QVBoxLayout(&dlg);
ActivitySelector *actSelector = new ActivitySelector(&dlg);
@@ -926,6 +958,7 @@ void ClearCasePlugin::startCheckInActivity()
dlg.setWindowTitle(tr("Check In Activity"));
if (!dlg.exec())
return;
QString topLevel = state.topLevel();
int topLevelLen = topLevel.length();
QStringList versions = ccGetActivityVersions(topLevel, actSelector->activity());
@@ -976,9 +1009,10 @@ void ClearCasePlugin::startCheckIn(const QString &workingDir, const QStringList
m_checkInMessageFileName = saver.fileName();
m_checkInView = workingDir;
// Create a submit editor and set file list
ClearCaseSubmitEditor *editor = openClearCaseSubmitEditor(m_checkInMessageFileName);
ClearCaseSubmitEditor *editor = openClearCaseSubmitEditor(m_checkInMessageFileName, m_isUcm);
editor->setStatusList(files);
if (files.size() == 1) {
if (m_isUcm && (files.size() == 1)) {
QString activity = ccGetFileActivity(workingDir, files.first());
editor->submitEditorWidget()->setActivity(activity);
}
@@ -1038,6 +1072,8 @@ void ClearCasePlugin::history(const QString &workingDir,
void ClearCasePlugin::viewStatus()
{
if (m_view.isEmpty())
m_view = ccGetView(m_topLevel);
QTC_ASSERT(!m_view.isEmpty() && !m_settings.disableIndexer, return);
VcsBase::VcsBaseOutputWindow *outputwindow = VcsBase::VcsBaseOutputWindow::instance();
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 title = QString::fromLatin1("Checkout %1").arg(file);
CheckOutDialog coDialog(title);
CheckOutDialog coDialog(title, m_isUcm);
if (!m_settings.disableIndexer &&
(fi.isWritable() || m_statusMap->value(relFile).status == FileStatus::Unknown))
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."));
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)
coDialog.hideHijack();
if (coDialog.exec() == QDialog::Accepted) {
if (!vcsSetActivity(topLevel, title, coDialog.activity()))
if (m_isUcm && !vcsSetActivity(topLevel, title, coDialog.activity()))
return false;
Core::FileChangeBlocker fcb(absPath);
QStringList args(QLatin1String("checkout"));
QString comment = coDialog.comment();
@@ -1311,6 +1350,14 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
if (coDialog.isPreserveTime())
args << QLatin1String("-ptime");
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...
// args << QLatin1String("-usehijack");
if (coDialog.isUseHijacked())
@@ -1420,7 +1467,7 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
const QString file = QDir::toNativeSeparators(fileName);
bool noCheckout = false;
QVBoxLayout *verticalLayout;
ActivitySelector *actSelector;
ActivitySelector *actSelector = 0;
QLabel *commentLabel;
QTextEdit *commentEdit;
QDialogButtonBox *buttonBox;
@@ -1428,8 +1475,10 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
fileOpDlg.setWindowTitle(title);
verticalLayout = new QVBoxLayout(&fileOpDlg);
actSelector = new ActivitySelector;
verticalLayout->addWidget(actSelector);
if (m_isUcm) {
actSelector = new ActivitySelector;
verticalLayout->addWidget(actSelector);
}
commentLabel = new QLabel(tr("Enter &comment:"));
verticalLayout->addWidget(commentLabel);
@@ -1450,9 +1499,11 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
if (!fileOpDlg.exec())
return true;
QString comment = commentEdit->toPlainText();
if (actSelector->changed())
if (m_isUcm && actSelector->changed())
vcsSetActivity(workingDir, fileOpDlg.windowTitle(), actSelector->activity());
QString dirName = QDir::toNativeSeparators(QFileInfo(workingDir, fileName).absolutePath());
QStringList commentArg;
if (comment.isEmpty())
@@ -1500,26 +1551,32 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
return true;
}
static QString baseName(const QString &fileName)
{
return fileName.mid(fileName.lastIndexOf(QLatin1Char('/')) + 1);
}
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);
}
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?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
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);
}
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);
}
@@ -1533,7 +1590,7 @@ QString ClearCasePlugin::vcsGetRepositoryURL(const QString & /*directory*/)
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
{
QString topLevelFound = findTopLevel(directory);
@@ -1640,7 +1697,18 @@ bool ClearCasePlugin::newActivity()
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"));
args << QLatin1String("-cview");
@@ -1652,7 +1720,13 @@ QString ClearCasePlugin::ccGetView(const QString &workingDir, bool *isDynamic) c
}
if (isDynamic)
*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()
@@ -1665,8 +1739,8 @@ void ClearCasePlugin::updateStreamAndView()
QRegExp intStreamExp(QLatin1String("stream:([^@]*)"));
if (intStreamExp.indexIn(sresponse.mid(tabPos + 1)) != -1)
m_intStream = intStreamExp.cap(1);
m_view = ccGetView(m_topLevel);
m_updateViewAction->setParameter(m_view);
m_view = ccGetView(m_topLevel, &m_isDynamic, &m_isUcm);
m_updateViewAction->setParameter(m_isDynamic ? QString() : m_view);
}
void ClearCasePlugin::projectChanged(ProjectExplorer::Project *project)

View File

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

View File

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

View File

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

View File

@@ -42,32 +42,26 @@
using namespace ClearCase::Internal;
ClearCaseSubmitEditorWidget::ClearCaseSubmitEditorWidget(QWidget *parent) :
Utils::SubmitEditorWidget(parent)
Utils::SubmitEditorWidget(parent),
m_actSelector(0)
{
setDescriptionMandatory(false);
QWidget *checkInWidget = new QWidget(this);
QVBoxLayout *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_verticalLayout = new QVBoxLayout(checkInWidget);
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"));
verticalLayout->addWidget(m_chkPTime);
m_verticalLayout->addWidget(m_chkPTime);
insertTopWidget(checkInWidget);
}
QString ClearCaseSubmitEditorWidget::activity() const
{
return m_actSelector->activity();
return m_actSelector ? m_actSelector->activity() : QString();
}
bool ClearCaseSubmitEditorWidget::isIdentical() const
@@ -82,17 +76,34 @@ bool ClearCaseSubmitEditorWidget::isPreserve() const
void ClearCaseSubmitEditorWidget::setActivity(const QString &act)
{
m_actSelector->setActivity(act);
if (m_actSelector)
m_actSelector->setActivity(act);
}
bool ClearCaseSubmitEditorWidget::activityChanged() const
{
return m_actSelector->changed();
return m_actSelector ? m_actSelector->changed() : false;
}
void ClearCaseSubmitEditorWidget::addKeep()
{
m_actSelector->addKeep();
if (m_actSelector)
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

View File

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

View File

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

View File

@@ -237,7 +237,7 @@ else:unix {
for(imagesize, IMAGE_SIZE_LIST) {
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}
}
}

View File

@@ -903,10 +903,22 @@ void CPPEditorWidget::onContentsChanged(int position, int charsRemoved, int char
void CPPEditorWidget::updateFileName()
{}
void CPPEditorWidget::jumpToOutlineElement(int)
void CPPEditorWidget::jumpToOutlineElement(int index)
{
QModelIndex index = m_proxyModel->mapToSource(m_outlineCombo->view()->currentIndex());
Symbol *symbol = m_outlineModel->symbolFromIndex(index);
QModelIndex modelIndex = m_outlineCombo->view()->currentIndex();
// 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)
return;

View File

@@ -272,9 +272,8 @@ KitConfigWidget *DebuggerKitInformation::createConfigWidget(Kit *k) const
QString DebuggerKitInformation::userOutput(const DebuggerItem &item)
{
const QString binary = item.binary.toUserOutput();
return binary.isEmpty() ?
tr("%1 <None>").arg(debuggerEngineName(item.engineType)) :
tr("%1 using '%2'").arg(debuggerEngineName(item.engineType), binary);
const QString name = debuggerEngineName(item.engineType);
return binary.isEmpty() ? tr("%1 <None>").arg(name) : tr("%1 using \"%2\"").arg(name, binary);
}
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;
if (sp.startMode == StartExternal) {
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.error;
stream << wd.state;
stream << wd.changed;
return stream;
}
@@ -257,7 +256,6 @@ QDataStream &operator>>(QDataStream &stream, WatchData &wd)
stream >> wd.valueEditable;
stream >> wd.error;
stream >> wd.state;
stream >> wd.changed;
return stream;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -550,7 +550,11 @@ void WatchTreeView::dragMoveEvent(QDragMoveEvent *ev)
void WatchTreeView::dropEvent(QDropEvent *ev)
{
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->setDropAction(Qt::CopyAction);
ev->accept();

View File

@@ -44,6 +44,7 @@
#if defined(QT_NO_WEBKIT)
#include <QTextBrowser>
#else
#include <QWebPage>
#include <QWebView>
#endif
@@ -140,6 +141,33 @@ private:
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 Help

View File

@@ -208,35 +208,6 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op,
? 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(QObject *parent)

View File

@@ -135,29 +135,32 @@ static QList<Abi> parseCoffHeader(const QByteArray &data)
break;
}
if (data.size() >= 68) {
if (data.size() >= 24) {
// Get Major and Minor Image Version from optional header fields
quint32 image = getLEUint32(data, 64);
if (image == 1) { // Image is 1 for mingw and higher for MSVC (4.something in some encoding)
quint8 minorLinker = data.at(23);
switch (data.at(22)) {
case 2:
case 3: // not yet reached:-)
flavor = Abi::WindowsMSysFlavor;
} else {
switch (data.at(22)) {
case 8:
flavor = Abi::WindowsMsvc2005Flavor;
break;
case 9:
flavor = Abi::WindowsMsvc2008Flavor;
break;
case 10:
flavor = Abi::WindowsMsvc2010Flavor;
break;
case 11:
flavor = Abi::WindowsMsvc2012Flavor;
break;
default: // Keep unknown flavor
break;
case 8:
flavor = Abi::WindowsMsvc2005Flavor;
break;
case 9:
flavor = Abi::WindowsMsvc2008Flavor;
break;
case 10:
flavor = Abi::WindowsMsvc2010Flavor;
break;
case 11:
flavor = Abi::WindowsMsvc2012Flavor;
break;
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);
break;
}
break;
}
}
@@ -791,9 +794,6 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
<< QString::fromLatin1("ppc-macos-generic-mach_o-32bit")
<< 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")
<< QString::fromLatin1("%1/dynamic/win-msvc2010-64bit.dll").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-windows-msvc2010-pe-64bit"));
@@ -806,6 +806,9 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
QTest::newRow("dynamic QtCore: win msys 32bit")
<< QString::fromLatin1("%1/dynamic/win-mingw-32bit.dll").arg(prefix)
<< (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")
<< QString::fromLatin1("%1/dynamic/wince-32bit.dll").arg(prefix)
<< (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
{
return hasIndex(row, column, parent) ? createIndex(row, column, 0) : QModelIndex();
return hasIndex(row, column, parent) ? createIndex(row, column) : QModelIndex();
}

View File

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

View File

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

View File

@@ -202,7 +202,19 @@ ToolChain *ToolChainKitInformation::toolChain(const Kit *k)
if (!k)
return 0;
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)

View File

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

View File

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

View File

@@ -38,6 +38,7 @@
#include <QFileDialog>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <QToolButton>
#include <QScrollArea>
#include <QSizePolicy>
@@ -45,43 +46,15 @@
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 {
KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, QWidget *parent) :
KitConfigWidget(parent),
m_layout(new QGridLayout),
m_iconButton(new QToolButton),
m_nameEdit(new QLineEdit),
m_kit(k)
{
m_layout->setMargin(0);
m_layout->setSpacing(6);
m_layout->setContentsMargins(0, 0, 0, 0);
QVBoxLayout *top = new QVBoxLayout(this);
top->setMargin(0);
@@ -96,27 +69,25 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, QWidget *parent) :
scroll->setWidget(details);
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);
QVBoxLayout *iconLayout = new QVBoxLayout;
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);
addToLayout(tr("Name:"), tr("Kit name and icon."), m_nameEdit, m_iconButton);
discard();
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(setIcon()));
connect(m_nameEdit, SIGNAL(textChanged(QString)), this, SIGNAL(dirty()));
}
QString KitManagerConfigWidget::displayName() const
{
return tr("Kits");
return m_nameEdit->text();
}
void KitManagerConfigWidget::apply()
@@ -124,6 +95,7 @@ void KitManagerConfigWidget::apply()
foreach (KitConfigWidget *w, m_widgets)
w->apply();
m_kit->setIconPath(m_iconPath);
m_kit->setDisplayName(m_nameEdit->text());
}
void KitManagerConfigWidget::discard()
@@ -132,6 +104,7 @@ void KitManagerConfigWidget::discard()
w->discard();
m_iconButton->setIcon(m_kit->icon());
m_iconPath = m_kit->iconPath();
m_nameEdit->setText(m_kit->displayName());
}
bool KitManagerConfigWidget::isDirty() const
@@ -139,7 +112,7 @@ bool KitManagerConfigWidget::isDirty() const
foreach (KitConfigWidget *w, m_widgets)
if (w->isDirty())
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)
@@ -148,7 +121,8 @@ void KitManagerConfigWidget::addConfigWidget(ProjectExplorer::KitConfigWidget *w
Q_ASSERT(!m_widgets.contains(widget));
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);
}
@@ -157,11 +131,12 @@ void KitManagerConfigWidget::makeReadOnly()
foreach (KitConfigWidget *w, m_widgets)
w->makeReadOnly();
m_iconButton->setEnabled(false);
m_nameEdit->setEnabled(false);
}
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())
return;
@@ -174,5 +149,32 @@ void KitManagerConfigWidget::setIcon()
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 ProjectExplorer

View File

@@ -36,6 +36,7 @@
QT_BEGIN_NAMESPACE
class QHBoxLayout;
class QGridLayout;
class QLineEdit;
class QToolButton;
QT_END_NAMESPACE
@@ -63,8 +64,21 @@ private slots:
void setIcon();
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;
QToolButton *m_iconButton;
QLineEdit *m_nameEdit;
QList<KitConfigWidget *> m_widgets;
Kit *m_kit;
QString m_iconPath;

View File

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

View File

@@ -69,7 +69,6 @@ public:
int columnCount(const QModelIndex &parent = QModelIndex()) 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;
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);
Q_ASSERT(t->project() == this);
// Check that we don't have a configuration with the same displayName
QString targetDisplayName = t->displayName();
QStringList displayNames;
foreach (const Target *target, d->m_targets)
displayNames << target->displayName();
targetDisplayName = makeUnique(targetDisplayName, displayNames);
t->setDefaultDisplayName(targetDisplayName);
t->setDefaultDisplayName(t->displayName());
// add it
d->m_targets.push_back(t);
@@ -243,9 +237,10 @@ Target *Project::target(Kit *k) const
return 0;
}
bool Project::supportsKit(Kit *k) const
bool Project::supportsKit(Kit *k, QString *errorMessage) const
{
Q_UNUSED(k);
Q_UNUSED(errorMessage);
return true;
}

View File

@@ -90,7 +90,7 @@ public:
void setActiveTarget(Target *target);
Target *target(const Core::Id id) 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 *restoreTarget(const QVariantMap &data);

View File

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

View File

@@ -55,6 +55,7 @@
#include <QStackedWidget>
#include <QToolTip>
#include <QVBoxLayout>
#include <QToolTip>
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
@@ -68,7 +69,8 @@ TargetSettingsPanelWidget::TargetSettingsPanelWidget(Project *project) :
m_currentTarget(0),
m_project(project),
m_selector(0),
m_centralWidget(0)
m_centralWidget(0),
m_lastAction(0)
{
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()
{
QVBoxLayout *viewLayout = new QVBoxLayout(this);
@@ -315,11 +344,14 @@ void TargetSettingsPanelWidget::updateTargetAddAndRemoveButtons()
foreach (Kit *k, KitManager::instance()->kits()) {
if (m_project->target(k))
continue;
if (!m_project->supportsKit(k))
continue;
QAction *action = new QAction(k->displayName(), m_addMenu);
action->setData(QVariant::fromValue(k->id()));
QString errorMessage;
if (!m_project->supportsKit(k, &errorMessage)) {
action->setEnabled(false);
action->setStatusTip(errorMessage);
}
bool inserted = false;
foreach (QAction *existing, m_addMenu->actions()) {

View File

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

View File

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

View File

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

View File

@@ -269,14 +269,19 @@ ProjectExplorer::IProjectManager *QmlProject::projectManager() const
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);
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;
}
// TODO: Limit supported versions?
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k);
if (!version && errorMessage)
*errorMessage = tr("No Qt version set in kit.");
return version;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -63,6 +63,8 @@ namespace Internal {
static const Core::Id QT_IS_TEMPORARY("Qt4PM.TempQt");
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");
class TargetSetupPageUi
@@ -276,7 +278,7 @@ void TargetSetupPage::setupWidgets()
void TargetSetupPage::reset()
{
foreach (Qt4TargetSetupWidget *widget, m_widgets.values()) {
ProjectExplorer::Kit *k = widget->profile();
ProjectExplorer::Kit *k = widget->kit();
if (!k)
continue;
removeProject(k, m_proFilePath);
@@ -296,9 +298,10 @@ ProjectExplorer::Kit *TargetSetupPage::createTemporaryKit(QtSupport::BaseQtVersi
ProjectExplorer::ToolChainKitInformation::setToolChain(k, version->preferredToolChain(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(TEMPORARY_OF_PROJECTS, QStringList() << m_proFilePath);
if (temporaryVersion)
k->setValue(QT_IS_TEMPORARY, version->uniqueId());
@@ -315,6 +318,11 @@ void TargetSetupPage::cleanKit(ProjectExplorer::Kit *k)
k->removeKey(KIT_IS_TEMPORARY);
k->removeKey(QT_IS_TEMPORARY);
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;
}
@@ -395,7 +403,6 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
QtSupport::BaseQtVersion *version = 0;
bool temporaryVersion = false;
ProjectExplorer::Kit *kit = 0;
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::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());
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()) {
QtSupport::BaseQtVersion *profileVersion = QtSupport::QtKitInformation::qtVersion(k);
Utils::FileName profileSpec = QmakeKitInformation::mkspec(k);
@@ -448,31 +456,33 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
if (profileVersion == version
&& profileSpec == parsedSpec)
kit = k;
kitList.append(k);
}
if (!kit)
kit = createTemporaryKit(version, temporaryVersion, parsedSpec);
else
addProject(kit, m_proFilePath);
if (kitList.isEmpty())
kitList.append(createTemporaryKit(version, temporaryVersion, parsedSpec));
// Create widget:
Qt4TargetSetupWidget *widget = m_widgets.value(kit->id(), 0);
if (!widget)
addWidget(kit);
widget = m_widgets.value(kit->id(), 0);
if (!widget)
continue;
foreach (ProjectExplorer::Kit *k, kitList) {
addProject(k, m_proFilePath);
// create info:
BuildConfigurationInfo info = BuildConfigurationInfo(makefileBuildConfig.first,
specArgument,
path.toString(),
true,
file);
// Create widget:
Qt4TargetSetupWidget *widget = m_widgets.value(k->id(), 0);
if (!widget)
addWidget(k);
widget = m_widgets.value(k->id(), 0);
if (!widget)
continue;
widget->addBuildConfigurationInfo(info, true);
widget->setKitSelected(true);
found = true;
// create info:
BuildConfigurationInfo info = BuildConfigurationInfo(makefileBuildConfig.first,
specArgument,
path.toString(),
true,
file);
widget->addBuildConfigurationInfo(info, true);
widget->setKitSelected(true);
found = true;
}
}
updateVisibility();
@@ -660,7 +670,7 @@ bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project)
if (!widget->isKitSelected())
continue;
ProjectExplorer::Kit *k = widget->profile();
ProjectExplorer::Kit *k = widget->kit();
cleanKit(k);
toRegister.append(KitBuildInfo(k, widget->selectedBuildConfigurationInfoList()));
widget->clearKit();

View File

@@ -349,7 +349,8 @@ void BaseQtVersion::fromMap(const QVariantMap &map)
QString string = map.value(QLatin1String(QTVERSIONQMAKEPATH)).toString();
if (string.startsWith(QLatin1Char('~')))
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
@@ -792,16 +793,19 @@ FileName BaseQtVersion::mkspec() const
FileName BaseQtVersion::mkspecFor(ProjectExplorer::ToolChain *tc) const
{
Utils::FileName versionSpec = mkspec();
if (!tc)
return mkspec();
return versionSpec;
const QList<FileName> tcSpecList = tc->suggestedMkspecList();
if (tcSpecList.contains(versionSpec))
return versionSpec;
foreach (const FileName &tcSpec, tcSpecList) {
if (hasMkspec(tcSpec))
return tcSpec;
}
return mkspec();
return versionSpec;
}
FileName BaseQtVersion::mkspecPath() const
@@ -1195,10 +1199,15 @@ bool BaseQtVersion::queryQMakeVariables(const FileName &binary, QHash<QString, Q
Environment env = Environment::systemEnvironment();
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();
foreach (ProjectExplorer::ToolChain *tc, tcList)
tc->addToEnvironment(env);
foreach (ProjectExplorer::ToolChain *tc, tcList) {
if (abiList.contains(tc->targetAbi()))
tc->addToEnvironment(env);
}
}
process.setEnvironment(env.toStringList());

View File

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

View File

@@ -634,19 +634,24 @@ static QString filterForQmakeFileDialog()
void QtOptionsPageWidget::addQtDir()
{
Utils::FileName qtVersion = Utils::FileName::fromString(
QFileDialog::getOpenFileName(this,
tr("Select a qmake executable"),
QString(),
filterForQmakeFileDialog(),
0,
QFileDialog::DontResolveSymlinks));
QFileInfo(QFileDialog::getOpenFileName(this,
tr("Select a qmake executable"),
QString(),
filterForQmakeFileDialog(),
0,
QFileDialog::DontResolveSymlinks)).canonicalFilePath());
if (qtVersion.isNull())
return;
if (QtVersionManager::instance()->qtVersionForQMakeBinary(qtVersion)) {
BaseQtVersion *version = QtVersionManager::instance()->qtVersionForQMakeBinary(qtVersion);
if (version) {
// 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) {
m_versions.append(version);

View File

@@ -623,9 +623,8 @@ Utils::FileName QtVersionManager::findQMakeBinaryFromMakefile(const QString &mak
#endif
// Is qmake still installed?
QFileInfo fi(qmakePath);
if (fi.exists()) {
return Utils::FileName(fi);
}
if (fi.exists())
return Utils::FileName::fromString(fi.canonicalFilePath());
}
}
}
@@ -634,13 +633,13 @@ Utils::FileName QtVersionManager::findQMakeBinaryFromMakefile(const QString &mak
BaseQtVersion *QtVersionManager::qtVersionForQMakeBinary(const Utils::FileName &qmakePath)
{
foreach (BaseQtVersion *version, versions()) {
if (version->qmakeCommand() == qmakePath) {
return version;
break;
}
}
return 0;
foreach (BaseQtVersion *version, versions()) {
if (version->qmakeCommand() == qmakePath) {
return version;
break;
}
}
return 0;
}
void dumpQMakeAssignments(const QList<QMakeAssignment> &list)

View File

@@ -291,6 +291,6 @@ void CodeStylePool::exportCodeStyle(const Utils::FileName &fileName, ICodeStyleP
tmp.insert(QLatin1String(displayNameKey), codeStyle->displayName());
tmp.insert(QLatin1String(codeStyleDataKey), map);
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/>
</property>
<property name="text">
<string>Visualisation: Minimum event cost:</string>
<string>Visualization: Minimum event cost:</string>
</property>
</widget>
</item>

View File

@@ -87,7 +87,7 @@ QModelIndex ErrorListModel::index(int row, int column, const QModelIndex &parent
QTC_ASSERT(parent.model() == this, qt_noop());
return QModelIndex();
}
return createIndex(row, column, 0);
return createIndex(row, column);
}
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());
if (child.internalId() == -1)
if (quintptr(child.internalId()) == quintptr(-1))
return QModelIndex();
return createIndex(child.internalId(), 0, -1);
}

View File

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

View File

@@ -109,9 +109,9 @@ CONFIG += plugin plugin_with_soname
linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
!macx {
target.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER
target.path = $$QTC_PREFIX/$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER
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
}

View File

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

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