forked from qt-creator/qt-creator
Merge remote-tracking branch 'gerrit/3.2'
Change-Id: I8e200637585eeea739840868d8450cba955df058
This commit is contained in:
136
dist/changes-3.2.0
vendored
136
dist/changes-3.2.0
vendored
@@ -5,21 +5,54 @@ list of changes, see the Git log for the Qt Creator sources that
|
|||||||
you can check out from the public Git repository. For example:
|
you can check out from the public Git repository. For example:
|
||||||
|
|
||||||
git clone git://gitorious.org/qt-creator/qt-creator.git
|
git clone git://gitorious.org/qt-creator/qt-creator.git
|
||||||
git log --cherry-pick --pretty=oneline origin/3.1..origin/master
|
git log --cherry-pick --pretty=oneline origin/3.1..origin/3.2
|
||||||
|
|
||||||
General
|
General
|
||||||
* Added "Get Help Online" context menu item to issues pane that searches for
|
* Added "Get Help Online" context menu item to issues pane that searches for
|
||||||
the issue description online in Google
|
the issue description online in Google
|
||||||
* Added action to file system locator filter ('f') for creating and opening a new file
|
* Added action to file system locator filter ('f') for creating and opening a new file
|
||||||
* Added search capability to general messages and most navigation panes
|
* Added search capability to general messages and most navigation panes
|
||||||
|
* Added display of current variable values in variable chooser dialog
|
||||||
|
* Added variable %{Env:...} for accessing environment variables
|
||||||
|
(where variables can be used)
|
||||||
* Enabled resizing of the locator field
|
* Enabled resizing of the locator field
|
||||||
* Improved look and feel on HiDPI by adding more hi-resolution icons
|
* Improved look and feel on HiDPI by adding more hi-resolution icons
|
||||||
|
* Made New dialog non-modal (QTCREATORBUG-6102)
|
||||||
* Made keyboard and mouse activation of navigation panes and other trees more consistent
|
* Made keyboard and mouse activation of navigation panes and other trees more consistent
|
||||||
* Added display of current variable values in variable chooser dialog
|
|
||||||
* Removed unhelpful Generic Highlighter loading progress bar
|
* Removed unhelpful Generic Highlighter loading progress bar
|
||||||
|
* Fixed case-sensitivity of file system locator filter (QTCREATORBUG-10843)
|
||||||
|
|
||||||
Editing
|
Editing
|
||||||
|
* Made Ctrl+Up and Ctrl+Down shortcuts configurable (QTCREATORBUG-4994)
|
||||||
|
* Made editor popup (Ctrl+Tab) adapt its size to contents (QTCREATORBUG-10618)
|
||||||
|
* Improved block editing (QTCREATORBUG-7773)
|
||||||
* Fixed support for mixed languages in the generic highlighter
|
* Fixed support for mixed languages in the generic highlighter
|
||||||
|
* Fixed title when printing (QTCREATORBUG-12161)
|
||||||
|
* Fixed that line number background color setting was ignored
|
||||||
|
(QTCREATORBUG-12170)
|
||||||
|
* Fixed that tooltips were shown when hovering over empty area
|
||||||
|
(QTCREATORBUG-9437)
|
||||||
|
* Fixed that tooltips were shown after triggering shortcut with
|
||||||
|
Alt key (QTCREATORBUG-12382)
|
||||||
|
* Fixed scroll behavior when editing same file in multiple splits
|
||||||
|
(QTCREATORBUG-11486)
|
||||||
|
* Fixed Open With when file is open in multiple splits
|
||||||
|
* Fixed that search highlights were removed when switching editors
|
||||||
|
(QTCREATORBUG-9949)
|
||||||
|
|
||||||
|
Help
|
||||||
|
* Added page up and page down shortcuts to topic chooser
|
||||||
|
* Added button for regenerating documentation index to Search pane
|
||||||
|
(QTCREATORBUG-11484)
|
||||||
|
* Changed documentation of examples to open in an external window
|
||||||
|
* Fixed that opening help in external window was not possible without
|
||||||
|
disabling help mode
|
||||||
|
* Fixed issue with F1 in help viewer showing 'No document' instead of opening
|
||||||
|
Help mode
|
||||||
|
* Fixed that context help was not showing latest Qt 5 documentation
|
||||||
|
(QTCREATORBUG-10331)
|
||||||
|
* Fixed reverted check state of Show Sidebar menu item
|
||||||
|
* Fixed selection behavior in documentation settings (QTCREATORBUG-12135)
|
||||||
|
|
||||||
Managing and Building Projects
|
Managing and Building Projects
|
||||||
|
|
||||||
@@ -27,11 +60,18 @@ QMake Projects
|
|||||||
* Added context menu item for copying resource path from entries in QRC
|
* Added context menu item for copying resource path from entries in QRC
|
||||||
files in project tree (QTCREATORBUG-11776)
|
files in project tree (QTCREATORBUG-11776)
|
||||||
* Added deployment support to plain C and C++ application wizards
|
* Added deployment support to plain C and C++ application wizards
|
||||||
|
* Added support for restricting automatic creation of run configurations
|
||||||
|
(QTCREATORBUG-10953)
|
||||||
|
* Added Show in Explorer context menu item for qrc nodes and their subnodes
|
||||||
|
in project tree (QTCREATORBUG-12374)
|
||||||
|
* Improved dropdown menu for selecting the project file when using wizard
|
||||||
|
to add files (QTCREATORBUG-12002)
|
||||||
* Removed warning about build directory below source directory for kits
|
* Removed warning about build directory below source directory for kits
|
||||||
with Qt 5.2 and later where this is supported (QTCREATORBUG-10024)
|
with Qt 5.2 and later where this is supported (QTCREATORBUG-10024)
|
||||||
* Fixed that adding files to .pri file was missing $$PWD
|
* Fixed that adding files to .pri file was missing $$PWD
|
||||||
|
|
||||||
Qbs Projects
|
Qbs Projects
|
||||||
|
* Added support for adding and removing files from projects
|
||||||
* Fixed that run configurations were created for products that are not runnable
|
* Fixed that run configurations were created for products that are not runnable
|
||||||
(QTCREATORBUG-12152)
|
(QTCREATORBUG-12152)
|
||||||
* Fixed that run configurations were created for disabled products (QBS-560)
|
* Fixed that run configurations were created for disabled products (QBS-560)
|
||||||
@@ -79,22 +119,48 @@ Debugging
|
|||||||
* Fixed debugging applications that are run in a terminal on Linux (QTCREATORBUG-3509)
|
* Fixed debugging applications that are run in a terminal on Linux (QTCREATORBUG-3509)
|
||||||
|
|
||||||
QML Profiler
|
QML Profiler
|
||||||
|
* Improved performance (QTCREATORBUG-12341)
|
||||||
|
* Fixed drawing issues (QTBUG-38222)
|
||||||
|
* Fixed that clicking visible event was sometimes moving timeline
|
||||||
|
(QTCREATORBUG-11945)
|
||||||
|
|
||||||
Analyzer
|
Analyzer
|
||||||
* Added support for Run in Terminal (QTCREATORBUG-7311)
|
* Added support for Run in Terminal (QTCREATORBUG-7311)
|
||||||
|
* Fixed passing of multiple arguments to application
|
||||||
|
|
||||||
C++ Support
|
C++ Support
|
||||||
|
* Added support for C99 designated initializers (QTCREATORBUG-1902)
|
||||||
* Fixed finding usages of members of typedef'ed anonymous structs
|
* Fixed finding usages of members of typedef'ed anonymous structs
|
||||||
(QTCREATORBUG-11859, QTCREATORBUG-11860)
|
(QTCREATORBUG-11859, QTCREATORBUG-11860)
|
||||||
* Fixed indentation of concatenated strings
|
* Fixed indentation of concatenated strings
|
||||||
* Fixed pointer typedef resolving (QTCREATORBUG-10021)
|
* Fixed pointer typedef resolving (QTCREATORBUG-10021)
|
||||||
* Fixed scroll wheel behavior in editor's symbols dropdown
|
* Fixed scroll wheel behavior in editor's symbols dropdown
|
||||||
|
* Fixed encoding issues (QTCREATORBUG-7356)
|
||||||
|
* Fixed that some wizards were ignoring configured file extensions
|
||||||
|
(QTCREATORBUG-12309)
|
||||||
|
* Fixed parsing of trailing type-specifier
|
||||||
|
* Fixed parsing of expressions like vector<int>{1}
|
||||||
|
* Fixed generating getters and setters for variables with
|
||||||
|
'm' and 'm_' prefixes
|
||||||
|
|
||||||
QML Support
|
QML Support
|
||||||
|
* Fixed handling of properties that start with underscore (QTCREATORBUG-12214)
|
||||||
|
|
||||||
Qt Quick Designer
|
Qt Quick Designer
|
||||||
|
* Changed puppet helper executable to be compiled on demand
|
||||||
|
* Added support for reloading states editor
|
||||||
|
* Improved gradient editor
|
||||||
|
* Fixed minimum and maximum sizes for Window component (QTCREATORBUG-12209)
|
||||||
|
* Fixed wrong password mode property on text fields
|
||||||
|
* Fixed that it was not possible to anchor to all possible targets
|
||||||
|
(QTCREATORBUG-12077)
|
||||||
|
* Fixed possible values for preferred highlight properties
|
||||||
|
(QTCREATORBUG-12216)
|
||||||
|
* Fixed setting empty text on Label and Text items (QTCREATORBUG-12119)
|
||||||
|
* Fixed property sections for TextEdit (QTCREATORBUG-12452)
|
||||||
|
|
||||||
Diff Viewer
|
Diff Viewer
|
||||||
|
* Reworked unified diff mode
|
||||||
|
|
||||||
Version Control Systems
|
Version Control Systems
|
||||||
* Git
|
* Git
|
||||||
@@ -122,6 +188,7 @@ Windows
|
|||||||
* Fixed detection of MSVC tool chains (QTCREATORBUG-10998)
|
* Fixed detection of MSVC tool chains (QTCREATORBUG-10998)
|
||||||
|
|
||||||
OS X
|
OS X
|
||||||
|
* Removed support for OS X 10.6
|
||||||
* Fixed activation of items with Enter in Bookmarks pane
|
* Fixed activation of items with Enter in Bookmarks pane
|
||||||
|
|
||||||
Android
|
Android
|
||||||
@@ -131,13 +198,68 @@ Remote Linux
|
|||||||
* Added custom remote executable run configuration type (QTCREATORBUG-12168)
|
* Added custom remote executable run configuration type (QTCREATORBUG-12168)
|
||||||
* Fixed issue with environment variables that contain spaces
|
* Fixed issue with environment variables that contain spaces
|
||||||
|
|
||||||
BareMetal:
|
QNX
|
||||||
|
* Added option to deploy Qt libraries to device options
|
||||||
|
|
||||||
|
BareMetal
|
||||||
* Added openocd pipelining support
|
* Added openocd pipelining support
|
||||||
* Added variable support for device specific GDB commands
|
* Added variable support for device specific GDB commands
|
||||||
|
|
||||||
Valgrind:
|
|
||||||
* Fixed passing of multiple arguments to application
|
|
||||||
|
|
||||||
|
|
||||||
Credits for these changes go to:
|
Credits for these changes go to:
|
||||||
|
|
||||||
|
Adam Strzelecki
|
||||||
|
Alessandro Portale
|
||||||
|
André Pönitz
|
||||||
|
Andrew Knight
|
||||||
|
Anton Kalmykov
|
||||||
|
Benjamin Zeller
|
||||||
|
Campbell Barton
|
||||||
|
Christian Kamm
|
||||||
|
Christian Kandeler
|
||||||
|
Christian Stenger
|
||||||
|
Daniel Teske
|
||||||
|
David Kaspar
|
||||||
|
David Schulz
|
||||||
|
Eike Ziller
|
||||||
|
El Mehdi Fekari
|
||||||
|
Erik Verbruggen
|
||||||
|
Evgenly Stepanov
|
||||||
|
Fawzi Mohamed
|
||||||
|
Frantisek Vacek
|
||||||
|
Friedemann Kleint
|
||||||
|
Hugues Delorme
|
||||||
|
Jaroslaw Kobus
|
||||||
|
Jerome Pasion
|
||||||
|
Jörg Bornemann
|
||||||
|
Kai Köhne
|
||||||
|
Karsten Heimrich
|
||||||
|
Knut Petter Svendsen
|
||||||
|
Leena Miettinen
|
||||||
|
Lorenz Haas
|
||||||
|
Lukas Holecek
|
||||||
|
Marco Bubke
|
||||||
|
Mitch Curtis
|
||||||
|
Niels Weber
|
||||||
|
Nikita Baryshnikov
|
||||||
|
Nikolai Kosjar
|
||||||
|
Oliver Wolff
|
||||||
|
Orgad Shaneh
|
||||||
|
Oswald Buddenhagen
|
||||||
|
Przemyslaw Gorszkowski
|
||||||
|
Rainer Keller
|
||||||
|
Robert Löhning
|
||||||
|
Sergey Shambir
|
||||||
|
Stephen Kelly
|
||||||
|
Sveinung Kvilhaugsvik
|
||||||
|
Thiago Macieira
|
||||||
|
Thomas Epting
|
||||||
|
Thomas Hartmann
|
||||||
|
Tim Jenssen
|
||||||
|
Tim Sander
|
||||||
|
Tobias Hunger
|
||||||
|
Tobias Nätterlund
|
||||||
|
Tom Deblauwe
|
||||||
|
Ulf Hermann
|
||||||
|
Vicken Simonian
|
||||||
|
Wang Hoi
|
||||||
|
Wiebe Cazemier
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
|
!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
|
||||||
QTCREATOR_PRI_INCLUDED = 1
|
QTCREATOR_PRI_INCLUDED = 1
|
||||||
|
|
||||||
QTCREATOR_VERSION = 3.1.82
|
QTCREATOR_VERSION = 3.1.83
|
||||||
QTCREATOR_COMPAT_VERSION = 3.1.82
|
QTCREATOR_COMPAT_VERSION = 3.1.83
|
||||||
BINARY_ARTIFACTS_BRANCH = master
|
BINARY_ARTIFACTS_BRANCH = master
|
||||||
|
|
||||||
# enable c++11
|
# enable c++11
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ Project {
|
|||||||
property bool withAutotests: qbs.buildVariant === "debug"
|
property bool withAutotests: qbs.buildVariant === "debug"
|
||||||
property string ide_version_major: '3'
|
property string ide_version_major: '3'
|
||||||
property string ide_version_minor: '1'
|
property string ide_version_minor: '1'
|
||||||
property string ide_version_release: '82'
|
property string ide_version_release: '83'
|
||||||
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release
|
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release
|
||||||
property string ide_compat_version_major: '3'
|
property string ide_compat_version_major: '3'
|
||||||
property string ide_compat_version_minor: '1'
|
property string ide_compat_version_minor: '1'
|
||||||
property string ide_compat_version_release: '82'
|
property string ide_compat_version_release: '83'
|
||||||
property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release
|
property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release
|
||||||
property path ide_source_tree: path
|
property path ide_source_tree: path
|
||||||
property string ide_app_path: qbs.targetOS.contains("osx") ? "" : "bin"
|
property string ide_app_path: qbs.targetOS.contains("osx") ? "" : "bin"
|
||||||
|
|||||||
@@ -600,9 +600,11 @@ class DumperBase:
|
|||||||
else:
|
else:
|
||||||
val = str(value.GetValue()) if self.isLldb else str(value)
|
val = str(value.GetValue()) if self.isLldb else str(value)
|
||||||
if index == -1:
|
if index == -1:
|
||||||
self.put('name="%s",' % val)
|
key = 'key="%s",' % val
|
||||||
else:
|
else:
|
||||||
self.put('key="[%d] %s",' % (index, val))
|
key = 'key="[%d] %s",' % (index, val)
|
||||||
|
self.put('key="%s",' % self.hexencode(key))
|
||||||
|
self.put('keyencoded="%s",' % Hex2EncodedLatin1)
|
||||||
|
|
||||||
def putPair(self, pair, index = -1):
|
def putPair(self, pair, index = -1):
|
||||||
if self.pairData.useKeyAndValue:
|
if self.pairData.useKeyAndValue:
|
||||||
@@ -1500,11 +1502,6 @@ class DumperBase:
|
|||||||
self.put('iname="%s",' % iname)
|
self.put('iname="%s",' % iname)
|
||||||
self.put('name="%s",' % exp)
|
self.put('name="%s",' % exp)
|
||||||
self.put('wname="%s",' % escapedExp)
|
self.put('wname="%s",' % escapedExp)
|
||||||
if len(exp) == 0: # The <Edit> case
|
|
||||||
self.putValue(" ")
|
|
||||||
self.putNoType()
|
|
||||||
self.putNumChild(0)
|
|
||||||
else:
|
|
||||||
try:
|
try:
|
||||||
value = self.parseAndEvaluate(exp)
|
value = self.parseAndEvaluate(exp)
|
||||||
self.putItem(value)
|
self.putItem(value)
|
||||||
|
|||||||
@@ -638,6 +638,9 @@ def qdump__QHash(d, value):
|
|||||||
d.putItem(it)
|
d.putItem(it)
|
||||||
|
|
||||||
|
|
||||||
|
def qform__QHashNode():
|
||||||
|
return mapForms()
|
||||||
|
|
||||||
def qdump__QHashNode(d, value):
|
def qdump__QHashNode(d, value):
|
||||||
key = value["key"]
|
key = value["key"]
|
||||||
if not key:
|
if not key:
|
||||||
@@ -645,6 +648,11 @@ def qdump__QHashNode(d, value):
|
|||||||
# for Qt4 optimized int keytype
|
# for Qt4 optimized int keytype
|
||||||
key = value[1]["key"]
|
key = value[1]["key"]
|
||||||
val = value["value"]
|
val = value["value"]
|
||||||
|
if d.isMapCompact(key.type, val.type):
|
||||||
|
d.putMapName(key)
|
||||||
|
d.putItem(val)
|
||||||
|
d.putType(value.type)
|
||||||
|
else:
|
||||||
d.putEmptyValue()
|
d.putEmptyValue()
|
||||||
d.putNumChild(2)
|
d.putNumChild(2)
|
||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ include(../../qtcreator.pri)
|
|||||||
include(../shared/qtsingleapplication/qtsingleapplication.pri)
|
include(../shared/qtsingleapplication/qtsingleapplication.pri)
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
CONFIG += qtc_runnable
|
||||||
TARGET = $$IDE_APP_TARGET
|
TARGET = $$IDE_APP_TARGET
|
||||||
DESTDIR = $$IDE_APP_PATH
|
DESTDIR = $$IDE_APP_PATH
|
||||||
|
|
||||||
|
|||||||
@@ -1158,11 +1158,13 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SubstitutionMap map;
|
SubstitutionMap map;
|
||||||
for (unsigned i = 0;
|
for (unsigned i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||||
i < argumentCountOfSpecialization && i < argumentCountOfInitialization;
|
const Name *name = templateSpecialization->templateParameterAt(i)->name();
|
||||||
++i) {
|
FullySpecifiedType ty = (i < argumentCountOfInitialization) ?
|
||||||
map.bind(templateSpecialization->templateParameterAt(i)->name(),
|
templId->templateArgumentAt(i):
|
||||||
templId->templateArgumentAt(i));
|
templateSpecialization->templateParameterAt(i)->type();
|
||||||
|
|
||||||
|
map.bind(name, ty);
|
||||||
}
|
}
|
||||||
SubstitutionEnvironment env;
|
SubstitutionEnvironment env;
|
||||||
env.enter(&map);
|
env.enter(&map);
|
||||||
|
|||||||
@@ -564,7 +564,7 @@ void Snapshot::insertLibraryInfo(const QString &path, const LibraryInfo &info)
|
|||||||
if (vNr.indexIn(myPath.last()) == 0) {
|
if (vNr.indexIn(myPath.last()) == 0) {
|
||||||
myPath.last() = vNr.cap(1);
|
myPath.last() = vNr.cap(1);
|
||||||
}
|
}
|
||||||
for (int iPath = myPath.size(); iPath != 0; ) {
|
for (int iPath = myPath.size(); iPath != 1; ) {
|
||||||
--iPath;
|
--iPath;
|
||||||
if (safeName.indexIn(myPath.at(iPath)) != 0)
|
if (safeName.indexIn(myPath.at(iPath)) != 0)
|
||||||
break;
|
break;
|
||||||
@@ -595,7 +595,7 @@ void Snapshot::insertLibraryInfo(const QString &path, const LibraryInfo &info)
|
|||||||
minorVersion = LanguageUtils::ComponentVersion::NoVersion;
|
minorVersion = LanguageUtils::ComponentVersion::NoVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int iPath = splitPath.size(); iPath != 0; ) {
|
for (int iPath = splitPath.size(); iPath != 1; ) {
|
||||||
--iPath;
|
--iPath;
|
||||||
if (safeName.indexIn(splitPath.at(iPath)) != 0)
|
if (safeName.indexIn(splitPath.at(iPath)) != 0)
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -299,8 +299,20 @@ bool FancyLineEdit::hasAutoHideButton(Side side) const
|
|||||||
void FancyLineEdit::setHistoryCompleter(const QString &historyKey)
|
void FancyLineEdit::setHistoryCompleter(const QString &historyKey)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!d->m_historyCompleter, return);
|
QTC_ASSERT(!d->m_historyCompleter, return);
|
||||||
d->m_historyCompleter = new HistoryCompleter(this, historyKey, this);
|
d->m_historyCompleter = new HistoryCompleter(historyKey, this);
|
||||||
QLineEdit::setCompleter(d->m_historyCompleter);
|
QLineEdit::setCompleter(d->m_historyCompleter);
|
||||||
|
|
||||||
|
// Hitting <Return> in the popup first causes editingFinished()
|
||||||
|
// being emitted and more updates finally calling setText() (again).
|
||||||
|
// To make sure we report the "final" content delay the addEntry()
|
||||||
|
// "a bit".
|
||||||
|
connect(this, SIGNAL(editingFinished()),
|
||||||
|
this, SLOT(onEditingFinished()), Qt::QueuedConnection);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FancyLineEdit::onEditingFinished()
|
||||||
|
{
|
||||||
|
d->m_historyCompleter->addEntry(text());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FancyLineEdit::setSpecialCompleter(QCompleter *completer)
|
void FancyLineEdit::setSpecialCompleter(QCompleter *completer)
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ signals:
|
|||||||
private slots:
|
private slots:
|
||||||
void iconClicked();
|
void iconClicked();
|
||||||
void onTextChanged(const QString &);
|
void onTextChanged(const QString &);
|
||||||
|
void onEditingFinished();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent *e);
|
void resizeEvent(QResizeEvent *e);
|
||||||
|
|||||||
@@ -47,19 +47,18 @@ static QSettings *theSettings = 0;
|
|||||||
class HistoryCompleterPrivate : public QAbstractListModel
|
class HistoryCompleterPrivate : public QAbstractListModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HistoryCompleterPrivate() : maxLines(30), lineEdit(0) {}
|
HistoryCompleterPrivate() : maxLines(30) {}
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(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 removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
|
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
|
||||||
|
|
||||||
void clearHistory();
|
void clearHistory();
|
||||||
void saveEntry(const QString &str);
|
void addEntry(const QString &str);
|
||||||
|
|
||||||
QStringList list;
|
QStringList list;
|
||||||
QString historyKey;
|
QString historyKey;
|
||||||
int maxLines;
|
int maxLines;
|
||||||
FancyLineEdit *lineEdit;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class HistoryLineDelegate : public QItemDelegate
|
class HistoryLineDelegate : public QItemDelegate
|
||||||
@@ -146,38 +145,33 @@ void HistoryCompleterPrivate::clearHistory()
|
|||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryCompleterPrivate::saveEntry(const QString &str)
|
void HistoryCompleterPrivate::addEntry(const QString &str)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(theSettings, return);
|
const QString entry = str.trimmed();
|
||||||
const QString &entry = str.trimmed();
|
if (entry.isEmpty())
|
||||||
|
return;
|
||||||
int removeIndex = list.indexOf(entry);
|
int removeIndex = list.indexOf(entry);
|
||||||
|
beginResetModel();
|
||||||
if (removeIndex != -1)
|
if (removeIndex != -1)
|
||||||
removeRow(removeIndex);
|
list.removeAt(removeIndex);
|
||||||
beginInsertRows (QModelIndex(), list.count(), list.count());
|
|
||||||
list.prepend(entry);
|
list.prepend(entry);
|
||||||
list = list.mid(0, maxLines);
|
list = list.mid(0, maxLines - 1);
|
||||||
endInsertRows();
|
endResetModel();
|
||||||
theSettings->setValue(historyKey, list);
|
theSettings->setValue(historyKey, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
HistoryCompleter::HistoryCompleter(FancyLineEdit *lineEdit, const QString &historyKey, QObject *parent)
|
HistoryCompleter::HistoryCompleter(const QString &historyKey, QObject *parent)
|
||||||
: QCompleter(parent),
|
: QCompleter(parent),
|
||||||
d(new HistoryCompleterPrivate)
|
d(new HistoryCompleterPrivate)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(lineEdit, return);
|
|
||||||
QTC_ASSERT(!historyKey.isEmpty(), return);
|
QTC_ASSERT(!historyKey.isEmpty(), return);
|
||||||
QTC_ASSERT(theSettings, return);
|
QTC_ASSERT(theSettings, return);
|
||||||
|
|
||||||
d->historyKey = QLatin1String("CompleterHistory/") + historyKey;
|
d->historyKey = QLatin1String("CompleterHistory/") + historyKey;
|
||||||
d->list = theSettings->value(d->historyKey).toStringList();
|
d->list = theSettings->value(d->historyKey).toStringList();
|
||||||
d->lineEdit = lineEdit;
|
|
||||||
if (d->list.count() && lineEdit->text().isEmpty())
|
|
||||||
lineEdit->setText(d->list.at(0));
|
|
||||||
|
|
||||||
setModel(d);
|
setModel(d);
|
||||||
setPopup(new HistoryLineView(d));
|
setPopup(new HistoryLineView(d));
|
||||||
|
|
||||||
connect(lineEdit, SIGNAL(editingFinished()), this, SLOT(saveHistory()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryCompleter::removeHistoryItem(int index)
|
bool HistoryCompleter::removeHistoryItem(int index)
|
||||||
@@ -210,9 +204,9 @@ void HistoryCompleter::clearHistory()
|
|||||||
d->clearHistory();
|
d->clearHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryCompleter::saveHistory()
|
void HistoryCompleter::addEntry(const QString &str)
|
||||||
{
|
{
|
||||||
d->saveEntry(d->lineEdit->text());
|
d->addEntry(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryCompleter::setSettings(QSettings *settings)
|
void HistoryCompleter::setSettings(QSettings *settings)
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
class FancyLineEdit;
|
|
||||||
namespace Internal { class HistoryCompleterPrivate; }
|
namespace Internal { class HistoryCompleterPrivate; }
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter
|
class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter
|
||||||
@@ -49,7 +48,7 @@ class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static void setSettings(QSettings *settings);
|
static void setSettings(QSettings *settings);
|
||||||
HistoryCompleter(FancyLineEdit *lineEdit, const QString &historyKey, QObject *parent = 0);
|
HistoryCompleter(const QString &historyKey, QObject *parent = 0);
|
||||||
bool removeHistoryItem(int index);
|
bool removeHistoryItem(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -60,7 +59,7 @@ private:
|
|||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void clearHistory();
|
void clearHistory();
|
||||||
void saveHistory();
|
void addEntry(const QString &str);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Internal::HistoryCompleterPrivate *d;
|
Internal::HistoryCompleterPrivate *d;
|
||||||
|
|||||||
@@ -31,18 +31,15 @@
|
|||||||
#include "bookmarkmanager.h"
|
#include "bookmarkmanager.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
|
|
||||||
using namespace Bookmarks::Internal;
|
using namespace Bookmarks::Internal;
|
||||||
|
|
||||||
Bookmark::Bookmark(const QString& fileName, int lineNumber, BookmarkManager *manager) :
|
Bookmark::Bookmark(const QString& fileName, int lineNumber, BookmarkManager *manager) :
|
||||||
BaseTextMark(fileName, lineNumber),
|
BaseTextMark(fileName, lineNumber),
|
||||||
m_manager(manager),
|
m_manager(manager)
|
||||||
m_fileName(fileName)
|
|
||||||
{
|
{
|
||||||
QFileInfo fi(fileName);
|
|
||||||
m_onlyFile = fi.fileName();
|
|
||||||
m_path = fi.path();
|
|
||||||
setPriority(TextEditor::ITextMark::NormalPriority);
|
setPriority(TextEditor::ITextMark::NormalPriority);
|
||||||
setIcon(m_manager->bookmarkIcon());
|
setIcon(m_manager->bookmarkIcon());
|
||||||
}
|
}
|
||||||
@@ -70,12 +67,8 @@ void Bookmark::updateBlock(const QTextBlock &block)
|
|||||||
|
|
||||||
void Bookmark::updateFileName(const QString &fileName)
|
void Bookmark::updateFileName(const QString &fileName)
|
||||||
{
|
{
|
||||||
m_fileName = fileName;
|
|
||||||
QFileInfo fi(fileName);
|
|
||||||
m_onlyFile = fi.fileName();
|
|
||||||
m_path = fi.path();
|
|
||||||
m_manager->updateBookmark(this);
|
|
||||||
BaseTextMark::updateFileName(fileName);
|
BaseTextMark::updateFileName(fileName);
|
||||||
|
m_manager->updateBookmark(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bookmark::setNote(const QString ¬e)
|
void Bookmark::setNote(const QString ¬e)
|
||||||
@@ -98,18 +91,3 @@ QString Bookmark::note() const
|
|||||||
{
|
{
|
||||||
return m_note;
|
return m_note;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Bookmark::filePath() const
|
|
||||||
{
|
|
||||||
return m_fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Bookmark::fileName() const
|
|
||||||
{
|
|
||||||
return m_onlyFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Bookmark::path() const
|
|
||||||
{
|
|
||||||
return m_path;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -33,8 +33,6 @@
|
|||||||
#include <texteditor/itexteditor.h>
|
#include <texteditor/itexteditor.h>
|
||||||
#include <texteditor/basetextmark.h>
|
#include <texteditor/basetextmark.h>
|
||||||
|
|
||||||
#include <QFileInfo>
|
|
||||||
|
|
||||||
namespace Bookmarks {
|
namespace Bookmarks {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -52,17 +50,11 @@ public:
|
|||||||
void updateNote(const QString ¬e);
|
void updateNote(const QString ¬e);
|
||||||
void removedFromEditor();
|
void removedFromEditor();
|
||||||
|
|
||||||
QString filePath() const;
|
|
||||||
QString fileName() const;
|
|
||||||
QString path() const;
|
|
||||||
QString lineText() const;
|
QString lineText() const;
|
||||||
QString note() const;
|
QString note() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BookmarkManager *m_manager;
|
BookmarkManager *m_manager;
|
||||||
QString m_fileName;
|
|
||||||
QString m_onlyFile;
|
|
||||||
QString m_path;
|
|
||||||
QString m_lineText;
|
QString m_lineText;
|
||||||
QString m_note;
|
QString m_note;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -353,8 +353,7 @@ QItemSelectionModel *BookmarkManager::selectionModel() const
|
|||||||
|
|
||||||
bool BookmarkManager::hasBookmarkInPosition(const QString &fileName, int lineNumber)
|
bool BookmarkManager::hasBookmarkInPosition(const QString &fileName, int lineNumber)
|
||||||
{
|
{
|
||||||
QFileInfo fi(fileName);
|
return findBookmark(fileName, lineNumber);
|
||||||
return findBookmark(fi.path(), fi.fileName(), lineNumber);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex BookmarkManager::index(int row, int column, const QModelIndex &parent) const
|
QModelIndex BookmarkManager::index(int row, int column, const QModelIndex &parent) const
|
||||||
@@ -390,19 +389,19 @@ QVariant BookmarkManager::data(const QModelIndex &index, int role) const
|
|||||||
if (!index.isValid() || index.column() !=0 || index.row() < 0 || index.row() >= m_bookmarksList.count())
|
if (!index.isValid() || index.column() !=0 || index.row() < 0 || index.row() >= m_bookmarksList.count())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
|
Bookmark *bookMark = m_bookmarksList.at(index.row());
|
||||||
if (role == BookmarkManager::Filename)
|
if (role == BookmarkManager::Filename)
|
||||||
return m_bookmarksList.at(index.row())->fileName();
|
return QFileInfo(bookMark->fileName()).fileName();
|
||||||
if (role == BookmarkManager::LineNumber)
|
if (role == BookmarkManager::LineNumber)
|
||||||
return m_bookmarksList.at(index.row())->lineNumber();
|
return bookMark->lineNumber();
|
||||||
if (role == BookmarkManager::Directory)
|
if (role == BookmarkManager::Directory)
|
||||||
return m_bookmarksList.at(index.row())->path();
|
return QFileInfo(bookMark->fileName()).path();
|
||||||
if (role == BookmarkManager::LineText)
|
if (role == BookmarkManager::LineText)
|
||||||
return m_bookmarksList.at(index.row())->lineText();
|
return bookMark->lineText();
|
||||||
if (role == BookmarkManager::Note)
|
if (role == BookmarkManager::Note)
|
||||||
return m_bookmarksList.at(index.row())->note();
|
return bookMark->note();
|
||||||
if (role == Qt::ToolTipRole)
|
if (role == Qt::ToolTipRole)
|
||||||
return QDir::toNativeSeparators(m_bookmarksList.at(index.row())->filePath());
|
return QDir::toNativeSeparators(bookMark->fileName());
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,18 +416,17 @@ void BookmarkManager::toggleBookmark()
|
|||||||
|
|
||||||
void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber)
|
void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber)
|
||||||
{
|
{
|
||||||
const QFileInfo fi(fileName);
|
|
||||||
const int editorLine = lineNumber;
|
const int editorLine = lineNumber;
|
||||||
|
|
||||||
// Remove any existing bookmark on this line
|
// Remove any existing bookmark on this line
|
||||||
if (Bookmark *mark = findBookmark(fi.path(), fi.fileName(), lineNumber)) {
|
if (Bookmark *mark = findBookmark(fileName, lineNumber)) {
|
||||||
// TODO check if the bookmark is really on the same markable Interface
|
// TODO check if the bookmark is really on the same markable Interface
|
||||||
removeBookmark(mark);
|
removeBookmark(mark);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a new bookmark if no bookmark existed on this line
|
// Add a new bookmark if no bookmark existed on this line
|
||||||
Bookmark *bookmark = new Bookmark(fi.filePath(), editorLine, this);
|
Bookmark *bookmark = new Bookmark(fileName, editorLine, this);
|
||||||
bookmark->init();
|
bookmark->init();
|
||||||
addBookmark(bookmark);
|
addBookmark(bookmark);
|
||||||
}
|
}
|
||||||
@@ -471,7 +469,7 @@ void BookmarkManager::removeBookmark(Bookmark *bookmark)
|
|||||||
int idx = m_bookmarksList.indexOf(bookmark);
|
int idx = m_bookmarksList.indexOf(bookmark);
|
||||||
beginRemoveRows(QModelIndex(), idx, idx);
|
beginRemoveRows(QModelIndex(), idx, idx);
|
||||||
|
|
||||||
const QFileInfo fi(bookmark->filePath() );
|
const QFileInfo fi(bookmark->fileName());
|
||||||
FileNameBookmarksMap *files = m_bookmarksMap.value(fi.path());
|
FileNameBookmarksMap *files = m_bookmarksMap.value(fi.path());
|
||||||
|
|
||||||
FileNameBookmarksMap::iterator i = files->begin();
|
FileNameBookmarksMap::iterator i = files->begin();
|
||||||
@@ -508,7 +506,7 @@ Bookmark *BookmarkManager::bookmarkForIndex(const QModelIndex &index) const
|
|||||||
|
|
||||||
bool BookmarkManager::gotoBookmark(Bookmark *bookmark)
|
bool BookmarkManager::gotoBookmark(Bookmark *bookmark)
|
||||||
{
|
{
|
||||||
if (IEditor *editor = EditorManager::openEditorAt(bookmark->filePath(), bookmark->lineNumber()))
|
if (IEditor *editor = EditorManager::openEditorAt(bookmark->fileName(), bookmark->lineNumber()))
|
||||||
return editor->currentLine() == bookmark->lineNumber();
|
return editor->currentLine() == bookmark->lineNumber();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -677,8 +675,7 @@ void BookmarkManager::moveDown()
|
|||||||
|
|
||||||
void BookmarkManager::editNote(const QString &fileName, int lineNumber)
|
void BookmarkManager::editNote(const QString &fileName, int lineNumber)
|
||||||
{
|
{
|
||||||
QFileInfo fi(fileName);
|
Bookmark *b = findBookmark(fileName, lineNumber);
|
||||||
Bookmark *b = findBookmark(fi.path(), fi.fileName(), lineNumber);
|
|
||||||
QModelIndex current = selectionModel()->currentIndex();
|
QModelIndex current = selectionModel()->currentIndex();
|
||||||
selectionModel()->setCurrentIndex(current.sibling(m_bookmarksList.indexOf(b), 0),
|
selectionModel()->setCurrentIndex(current.sibling(m_bookmarksList.indexOf(b), 0),
|
||||||
QItemSelectionModel::Select | QItemSelectionModel::Clear);
|
QItemSelectionModel::Select | QItemSelectionModel::Clear);
|
||||||
@@ -703,10 +700,12 @@ void BookmarkManager::editNote()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the bookmark at the given file and line number, or 0 if no such bookmark exists. */
|
/* Returns the bookmark at the given file and line number, or 0 if no such bookmark exists. */
|
||||||
Bookmark *BookmarkManager::findBookmark(const QString &path, const QString &fileName, int lineNumber)
|
Bookmark *BookmarkManager::findBookmark(const QString &filePath, int lineNumber)
|
||||||
{
|
{
|
||||||
|
QFileInfo fi(filePath);
|
||||||
|
QString path = fi.path();
|
||||||
if (m_bookmarksMap.contains(path)) {
|
if (m_bookmarksMap.contains(path)) {
|
||||||
foreach (Bookmark *bookmark, m_bookmarksMap.value(path)->values(fileName)) {
|
foreach (Bookmark *bookmark, m_bookmarksMap.value(path)->values(fi.fileName())) {
|
||||||
if (bookmark->lineNumber() == lineNumber)
|
if (bookmark->lineNumber() == lineNumber)
|
||||||
return bookmark;
|
return bookmark;
|
||||||
}
|
}
|
||||||
@@ -721,7 +720,7 @@ Bookmark *BookmarkManager::findBookmark(const QString &path, const QString &file
|
|||||||
void BookmarkManager::addBookmark(Bookmark *bookmark, bool userset)
|
void BookmarkManager::addBookmark(Bookmark *bookmark, bool userset)
|
||||||
{
|
{
|
||||||
beginInsertRows(QModelIndex(), m_bookmarksList.size(), m_bookmarksList.size());
|
beginInsertRows(QModelIndex(), m_bookmarksList.size(), m_bookmarksList.size());
|
||||||
const QFileInfo fi(bookmark->filePath());
|
const QFileInfo fi(bookmark->fileName());
|
||||||
const QString &path = fi.path();
|
const QString &path = fi.path();
|
||||||
|
|
||||||
if (!m_bookmarksMap.contains(path))
|
if (!m_bookmarksMap.contains(path))
|
||||||
@@ -752,9 +751,7 @@ void BookmarkManager::addBookmark(const QString &s)
|
|||||||
const QString &filePath = s.mid(index1+1, index2-index1-1);
|
const QString &filePath = s.mid(index1+1, index2-index1-1);
|
||||||
const QString ¬e = s.mid(index3 + 1);
|
const QString ¬e = s.mid(index3 + 1);
|
||||||
const int lineNumber = s.mid(index2 + 1, index3 - index2 - 1).toInt();
|
const int lineNumber = s.mid(index2 + 1, index3 - index2 - 1).toInt();
|
||||||
const QFileInfo fi(filePath);
|
if (!filePath.isEmpty() && !findBookmark(filePath, lineNumber)) {
|
||||||
|
|
||||||
if (!filePath.isEmpty() && !findBookmark(fi.path(), fi.fileName(), lineNumber)) {
|
|
||||||
Bookmark *b = new Bookmark(filePath, lineNumber, this);
|
Bookmark *b = new Bookmark(filePath, lineNumber, this);
|
||||||
b->setNote(note);
|
b->setNote(note);
|
||||||
b->init();
|
b->init();
|
||||||
@@ -771,8 +768,7 @@ QString BookmarkManager::bookmarkToString(const Bookmark *b)
|
|||||||
const QLatin1Char colon(':');
|
const QLatin1Char colon(':');
|
||||||
// Using \t as delimiter because any another symbol can be a part of note.
|
// Using \t as delimiter because any another symbol can be a part of note.
|
||||||
const QLatin1Char noteDelimiter('\t');
|
const QLatin1Char noteDelimiter('\t');
|
||||||
// Empty string was the name of the bookmark, which now is always ""
|
return colon + b->fileName() +
|
||||||
return QLatin1String("") + colon + b->filePath() +
|
|
||||||
colon + QString::number(b->lineNumber()) +
|
colon + QString::number(b->lineNumber()) +
|
||||||
noteDelimiter + b->note();
|
noteDelimiter + b->note();
|
||||||
}
|
}
|
||||||
@@ -821,8 +817,7 @@ void BookmarkManager::handleBookmarkTooltipRequest(ITextEditor *textEditor, cons
|
|||||||
int line)
|
int line)
|
||||||
{
|
{
|
||||||
if (textEditor->document()) {
|
if (textEditor->document()) {
|
||||||
const QFileInfo fi(textEditor->document()->filePath());
|
Bookmark *mark = findBookmark(textEditor->document()->filePath(), line);
|
||||||
Bookmark *mark = findBookmark(fi.path(), fi.fileName(), line);
|
|
||||||
operateTooltip(textEditor, pos, mark);
|
operateTooltip(textEditor, pos, mark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
void documentPrevNext(bool next);
|
void documentPrevNext(bool next);
|
||||||
|
|
||||||
Bookmark *findBookmark(const QString &path, const QString &fileName, int lineNumber);
|
Bookmark *findBookmark(const QString &filePath, int lineNumber);
|
||||||
void addBookmark(Bookmark *bookmark, bool userset = true);
|
void addBookmark(Bookmark *bookmark, bool userset = true);
|
||||||
void addBookmark(const QString &s);
|
void addBookmark(const QString &s);
|
||||||
static QString bookmarkToString(const Bookmark *b);
|
static QString bookmarkToString(const Bookmark *b);
|
||||||
|
|||||||
@@ -2281,6 +2281,20 @@ void CppToolsPlugin::test_completion_data()
|
|||||||
<< QLatin1String("Derived")
|
<< QLatin1String("Derived")
|
||||||
<< QLatin1String("foo")
|
<< QLatin1String("foo")
|
||||||
<< QLatin1String("Foo"));
|
<< QLatin1String("Foo"));
|
||||||
|
|
||||||
|
QTest::newRow("default_arguments_for_class_templates_and_template_base_class_QTCREATORBUG-12606") << _(
|
||||||
|
"struct Foo { int foo; };\n"
|
||||||
|
"template <typename T>\n"
|
||||||
|
"struct Base { T t; };\n"
|
||||||
|
"template <typename T = Foo>\n"
|
||||||
|
"struct Derived : Base<T> {};\n"
|
||||||
|
"void fun() {\n"
|
||||||
|
" Derived<> derived;\n"
|
||||||
|
" @\n"
|
||||||
|
"}\n"
|
||||||
|
) << _("derived.t.") << (QStringList()
|
||||||
|
<< QLatin1String("foo")
|
||||||
|
<< QLatin1String("Foo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppToolsPlugin::test_completion_member_access_operator()
|
void CppToolsPlugin::test_completion_member_access_operator()
|
||||||
|
|||||||
@@ -526,7 +526,8 @@ SemanticInfo CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::So
|
|||||||
const QSharedPointer<SnapshotUpdater> snapshotUpdater = snapshotUpdater_internal();
|
const QSharedPointer<SnapshotUpdater> snapshotUpdater = snapshotUpdater_internal();
|
||||||
QTC_ASSERT(snapshotUpdater, return newSemanticInfo);
|
QTC_ASSERT(snapshotUpdater, return newSemanticInfo);
|
||||||
newSemanticInfo.snapshot = snapshotUpdater->snapshot();
|
newSemanticInfo.snapshot = snapshotUpdater->snapshot();
|
||||||
QTC_ASSERT(newSemanticInfo.snapshot.contains(source.fileName), return newSemanticInfo);
|
if (!newSemanticInfo.snapshot.contains(source.fileName))
|
||||||
|
return newSemanticInfo; // SnapshotUpdater::update() not yet started.
|
||||||
Document::Ptr doc = newSemanticInfo.snapshot.preprocessedDocument(source.code,
|
Document::Ptr doc = newSemanticInfo.snapshot.preprocessedDocument(source.code,
|
||||||
source.fileName);
|
source.fileName);
|
||||||
if (processor)
|
if (processor)
|
||||||
|
|||||||
@@ -684,8 +684,6 @@ static QString quoteUnprintable(const QString &str)
|
|||||||
static QString translate(const QString &str)
|
static QString translate(const QString &str)
|
||||||
{
|
{
|
||||||
if (str.startsWith(QLatin1Char('<'))) {
|
if (str.startsWith(QLatin1Char('<'))) {
|
||||||
if (str == QLatin1String("<Edit>"))
|
|
||||||
return WatchHandler::tr("<Edit>");
|
|
||||||
if (str == QLatin1String("<empty>"))
|
if (str == QLatin1String("<empty>"))
|
||||||
return WatchHandler::tr("<empty>");
|
return WatchHandler::tr("<empty>");
|
||||||
if (str == QLatin1String("<uninitialized>"))
|
if (str == QLatin1String("<uninitialized>"))
|
||||||
@@ -1063,9 +1061,7 @@ static QString expression(const WatchItem *item)
|
|||||||
QString WatchModel::displayName(const WatchItem *item) const
|
QString WatchModel::displayName(const WatchItem *item) const
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
if (item->parent == m_watchRoot && item->name.isEmpty())
|
if (item->parent == m_returnRoot)
|
||||||
result = tr("<Edit>");
|
|
||||||
else if (item->parent == m_returnRoot)
|
|
||||||
result = tr("returned value");
|
result = tr("returned value");
|
||||||
else if (item->name == QLatin1String("*"))
|
else if (item->name == QLatin1String("*"))
|
||||||
result = QLatin1Char('*') + item->parent->name;
|
result = QLatin1Char('*') + item->parent->name;
|
||||||
|
|||||||
@@ -554,8 +554,7 @@ void WatchTreeView::mouseDoubleClickEvent(QMouseEvent *ev)
|
|||||||
{
|
{
|
||||||
const QModelIndex idx = indexAt(ev->pos());
|
const QModelIndex idx = indexAt(ev->pos());
|
||||||
if (!idx.isValid()) {
|
if (!idx.isValid()) {
|
||||||
// The "<Edit>" case.
|
inputNewExpression();
|
||||||
watchExpression(QString());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BaseTreeView::mouseDoubleClickEvent(ev);
|
BaseTreeView::mouseDoubleClickEvent(ev);
|
||||||
@@ -921,12 +920,7 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
if (!act) {
|
if (!act) {
|
||||||
;
|
;
|
||||||
} else if (act == &actInsertNewWatchItem) {
|
} else if (act == &actInsertNewWatchItem) {
|
||||||
bool ok;
|
inputNewExpression();
|
||||||
QString newExp = QInputDialog::getText(this, tr("Enter Expression for Evaluator"),
|
|
||||||
tr("Expression:"), QLineEdit::Normal,
|
|
||||||
QString(), &ok);
|
|
||||||
if (ok && !newExp.isEmpty())
|
|
||||||
watchExpression(newExp);
|
|
||||||
} else if (act == &actOpenMemoryEditAtObjectAddress) {
|
} else if (act == &actOpenMemoryEditAtObjectAddress) {
|
||||||
addVariableMemoryView(currentEngine(), false, mi0, false, ev->globalPos(), this);
|
addVariableMemoryView(currentEngine(), false, mi0, false, ev->globalPos(), this);
|
||||||
} else if (act == &actOpenMemoryEditAtPointerAddress) {
|
} else if (act == &actOpenMemoryEditAtPointerAddress) {
|
||||||
@@ -1090,5 +1084,15 @@ void WatchTreeView::setModelData
|
|||||||
model()->setData(index, value, role);
|
model()->setData(index, value, role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WatchTreeView::inputNewExpression()
|
||||||
|
{
|
||||||
|
bool ok;
|
||||||
|
QString exp = QInputDialog::getText(this, tr("Enter Expression for Evaluator"),
|
||||||
|
tr("Expression:"), QLineEdit::Normal,
|
||||||
|
QString(), &ok);
|
||||||
|
if (ok && !exp.isEmpty())
|
||||||
|
watchExpression(exp, exp);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ private:
|
|||||||
bool event(QEvent *ev);
|
bool event(QEvent *ev);
|
||||||
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
||||||
|
|
||||||
|
void inputNewExpression();
|
||||||
void editItem(const QModelIndex &idx);
|
void editItem(const QModelIndex &idx);
|
||||||
void resetHelper(const QModelIndex &idx);
|
void resetHelper(const QModelIndex &idx);
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
#include "qmldesignerplugin.h"
|
#include "qmldesignerplugin.h"
|
||||||
|
|
||||||
#include "puppetcreator.h"
|
#include "puppetcreator.h"
|
||||||
|
#include <qmldesignerwarning.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
@@ -175,8 +176,7 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::warning(Core::ICore::dialogParent(),
|
QmlDesignerWarning::show(tr("Cannot Start QML Puppet Executable"),
|
||||||
tr("Cannot Start QML Puppet Executable"),
|
|
||||||
tr("The executable of the QML Puppet process cannot be started or is hanging."));
|
tr("The executable of the QML Puppet process cannot be started or is hanging."));
|
||||||
|
|
||||||
QmlDesignerPlugin::instance()->switchToTextModeDeferred();
|
QmlDesignerPlugin::instance()->switchToTextModeDeferred();
|
||||||
|
|||||||
@@ -730,39 +730,67 @@ void TextToModelMerger::setupImports(const Document::Ptr &doc,
|
|||||||
differenceHandler.importAbsentInQMl(import);
|
differenceHandler.importAbsentInQMl(import);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextToModelMerger::setupPossibleImports(const QmlJS::Snapshot &snapshot, const QmlJS::ViewerContext &viewContext)
|
static bool isLatestImportVersion(const ImportKey &importKey, const QHash<QString, ImportKey> &filteredPossibleImportKeys)
|
||||||
{
|
{
|
||||||
QList<Import> possibleImports;
|
return !filteredPossibleImportKeys.contains(importKey.path())
|
||||||
|
|
||||||
QSet<ImportKey> possibleImportKeys = snapshot.importDependencies()->libraryImports(viewContext);
|
|
||||||
|
|
||||||
QHash<QString, ImportKey> filteredPossibleImportKeys;
|
|
||||||
foreach (const ImportKey &importKey, possibleImportKeys) {
|
|
||||||
if (!filteredPossibleImportKeys.contains(importKey.path())
|
|
||||||
|| filteredPossibleImportKeys.value(importKey.path()).majorVersion < importKey.majorVersion
|
|| filteredPossibleImportKeys.value(importKey.path()).majorVersion < importKey.majorVersion
|
||||||
|| (filteredPossibleImportKeys.value(importKey.path()).majorVersion == importKey.majorVersion
|
|| (filteredPossibleImportKeys.value(importKey.path()).majorVersion == importKey.majorVersion
|
||||||
&& filteredPossibleImportKeys.value(importKey.path()).minorVersion < importKey.minorVersion))
|
&& filteredPossibleImportKeys.value(importKey.path()).minorVersion < importKey.minorVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isBlacklistImport(const ImportKey &importKey)
|
||||||
|
{
|
||||||
|
QString importPathFirst = importKey.splitPath.first();
|
||||||
|
QString importPathLast = importKey.splitPath.last();
|
||||||
|
return importPathFirst == QStringLiteral("<cpp>")
|
||||||
|
|| importPathFirst == QStringLiteral("QML")
|
||||||
|
|| importPathFirst == QStringLiteral("QtQml")
|
||||||
|
|| (importPathFirst == QStringLiteral("QtQuick") && importPathLast == QStringLiteral("PrivateWidgets"))
|
||||||
|
|| importPathLast == QStringLiteral("Private")
|
||||||
|
|| (importKey.splitPath.count() == 1 && importPathFirst == QStringLiteral("QtQuick")); // Don't show Quick X.X imports
|
||||||
|
}
|
||||||
|
|
||||||
|
static QHash<QString, ImportKey> filterPossibleImportKeys(const QSet<ImportKey> &possibleImportKeys)
|
||||||
|
{
|
||||||
|
QHash<QString, ImportKey> filteredPossibleImportKeys;
|
||||||
|
foreach (const ImportKey &importKey, possibleImportKeys) {
|
||||||
|
if (isLatestImportVersion(importKey, filteredPossibleImportKeys) && !isBlacklistImport(importKey))
|
||||||
filteredPossibleImportKeys.insert(importKey.path(), importKey);
|
filteredPossibleImportKeys.insert(importKey.path(), importKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredPossibleImportKeys.remove(QStringLiteral("<cpp>"));
|
return filteredPossibleImportKeys;
|
||||||
filteredPossibleImportKeys.remove(QStringLiteral("QML"));
|
}
|
||||||
filteredPossibleImportKeys.remove(QStringLiteral("QtQml"));
|
|
||||||
filteredPossibleImportKeys.remove(QStringLiteral("QtQuick/PrivateWidgets"));
|
|
||||||
|
|
||||||
QList<QmlJS::Import> allImports = m_scopeChain->context()->imports(m_document.data())->all();
|
static void removeUsedImports(QHash<QString, ImportKey> &filteredPossibleImportKeys, const QList<QmlJS::Import> &usedImports)
|
||||||
|
{
|
||||||
foreach (const QmlJS::Import &import, allImports) {
|
foreach (const QmlJS::Import &import, usedImports)
|
||||||
filteredPossibleImportKeys.remove(import.info.path());
|
filteredPossibleImportKeys.remove(import.info.path());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QList<QmlDesigner::Import> generatePossibleImports(const QHash<QString, ImportKey> &filteredPossibleImportKeys)
|
||||||
|
{
|
||||||
|
QList<QmlDesigner::Import> possibleImports;
|
||||||
|
|
||||||
foreach (const ImportKey &importKey, filteredPossibleImportKeys) {
|
foreach (const ImportKey &importKey, filteredPossibleImportKeys) {
|
||||||
QString libraryName = importKey.splitPath.join(QLatin1Char('.'));
|
QString libraryName = importKey.splitPath.join(QLatin1Char('.'));
|
||||||
QString version = QString(QStringLiteral("%1.%2")
|
int majorVersion = importKey.majorVersion;
|
||||||
.arg((importKey.majorVersion == LanguageUtils::ComponentVersion::NoVersion) ? 1 : importKey.majorVersion)
|
if (majorVersion >= 0) {
|
||||||
.arg((importKey.minorVersion == LanguageUtils::ComponentVersion::NoVersion) ? 0 : importKey.minorVersion));
|
int minorVersion = (importKey.minorVersion == LanguageUtils::ComponentVersion::NoVersion) ? 0 : importKey.minorVersion;
|
||||||
possibleImports.append(Import::createLibraryImport(libraryName, version));
|
QString version = QStringLiteral("%1.%2").arg(majorVersion).arg(minorVersion);
|
||||||
|
possibleImports.append(QmlDesigner::Import::createLibraryImport(libraryName, version));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return possibleImports;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextToModelMerger::setupPossibleImports(const QmlJS::Snapshot &snapshot, const QmlJS::ViewerContext &viewContext)
|
||||||
|
{
|
||||||
|
QHash<QString, ImportKey> filteredPossibleImportKeys = filterPossibleImportKeys(snapshot.importDependencies()->libraryImports(viewContext));
|
||||||
|
|
||||||
|
removeUsedImports(filteredPossibleImportKeys, m_scopeChain->context()->imports(m_document.data())->all());
|
||||||
|
|
||||||
|
QList<QmlDesigner::Import> possibleImports = generatePossibleImports(filteredPossibleImportKeys);
|
||||||
|
|
||||||
if ( m_rewriterView->isAttached())
|
if ( m_rewriterView->isAttached())
|
||||||
m_rewriterView->model()->setPossibleImports(possibleImports);
|
m_rewriterView->model()->setPossibleImports(possibleImports);
|
||||||
@@ -783,11 +811,6 @@ void TextToModelMerger::setupUsedImports()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// even if not explicitly used we probably want to keep QtQuick imports
|
|
||||||
usedImports.append(Import::createLibraryImport("QtQuick", "1.0"));
|
|
||||||
usedImports.append(Import::createLibraryImport("QtQuick", "1.1"));
|
|
||||||
usedImports.append(Import::createLibraryImport("QtQuick", "2.0"));
|
|
||||||
usedImports.append(Import::createLibraryImport("QtQuick", "2.1"));
|
|
||||||
|
|
||||||
if (m_rewriterView->isAttached())
|
if (m_rewriterView->isAttached())
|
||||||
m_rewriterView->model()->setUsedImports(usedImports);
|
m_rewriterView->model()->setUsedImports(usedImports);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ void StopMonitoringHandler::handle(const ProjectExplorer::Task &task)
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(canHandle(task), return);
|
QTC_ASSERT(canHandle(task), return);
|
||||||
Q_UNUSED(task);
|
Q_UNUSED(task);
|
||||||
TaskList::TaskListPlugin::stopMonitoring();
|
TaskListPlugin::stopMonitoring();
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *StopMonitoringHandler::createAction(QObject *parent) const
|
QAction *StopMonitoringHandler::createAction(QObject *parent) const
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ bool TaskFile::reload(QString *errorString, ReloadFlag flag, ChangeType type)
|
|||||||
bool TaskFile::open(QString *errorString, const QString &fileName)
|
bool TaskFile::open(QString *errorString, const QString &fileName)
|
||||||
{
|
{
|
||||||
setFilePath(fileName);
|
setFilePath(fileName);
|
||||||
return TaskList::TaskListPlugin::loadFile(errorString, m_baseDir, fileName);
|
return TaskListPlugin::loadFile(errorString, m_baseDir, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TaskFile::baseDir() const
|
QString TaskFile::baseDir() const
|
||||||
|
|||||||
@@ -1,89 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "taskfilefactory.h"
|
|
||||||
|
|
||||||
#include "taskfile.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
|
||||||
#include <projectexplorer/project.h>
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/documentmanager.h>
|
|
||||||
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
using namespace TaskList::Internal;
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
// TaskFileFactory
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
TaskFileFactory::TaskFileFactory(QObject * parent) :
|
|
||||||
Core::IDocumentFactory(parent)
|
|
||||||
{
|
|
||||||
setId("ProjectExplorer.TaskFileFactory");
|
|
||||||
setDisplayName(tr("Task file reader"));
|
|
||||||
addMimeType(QLatin1String("text/x-tasklist"));
|
|
||||||
setOpener([this](const QString &fileName) -> Core::IDocument * {
|
|
||||||
ProjectExplorer::Project *project = ProjectExplorer::ProjectExplorerPlugin::currentProject();
|
|
||||||
return this->open(project ? project->projectDirectory().toString() : QString(), fileName);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::IDocument *TaskFileFactory::open(const QString &base, const QString &fileName)
|
|
||||||
{
|
|
||||||
foreach (TaskFile *doc, m_openFiles) {
|
|
||||||
if (doc->filePath() == fileName)
|
|
||||||
return doc;
|
|
||||||
}
|
|
||||||
|
|
||||||
TaskFile *file = new TaskFile(this);
|
|
||||||
file->setBaseDir(base);
|
|
||||||
|
|
||||||
QString errorString;
|
|
||||||
if (!file->open(&errorString, fileName)) {
|
|
||||||
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), errorString);
|
|
||||||
delete file;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_openFiles.append(file);
|
|
||||||
|
|
||||||
// Register with filemanager:
|
|
||||||
Core::DocumentManager::addDocument(file);
|
|
||||||
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TaskFileFactory::closeAllFiles()
|
|
||||||
{
|
|
||||||
foreach (TaskFile *document, m_openFiles)
|
|
||||||
document->deleteLater();
|
|
||||||
m_openFiles.clear();
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef TASKFILEFACTORY_H
|
|
||||||
#define TASKFILEFACTORY_H
|
|
||||||
|
|
||||||
#include <coreplugin/idocumentfactory.h>
|
|
||||||
#include <coreplugin/idocument.h>
|
|
||||||
|
|
||||||
namespace ProjectExplorer { class Project; }
|
|
||||||
|
|
||||||
namespace TaskList {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class TaskFile;
|
|
||||||
|
|
||||||
class TaskFileFactory : public Core::IDocumentFactory
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
TaskFileFactory(QObject *parent = 0);
|
|
||||||
|
|
||||||
Core::IDocument *open(const QString &base, const QString &fileName);
|
|
||||||
|
|
||||||
void closeAllFiles();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QList<TaskFile *> m_openFiles;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace TaskList
|
|
||||||
|
|
||||||
#endif // TASKFILEFACTORY_H
|
|
||||||
@@ -4,11 +4,9 @@ HEADERS += tasklistplugin.h \
|
|||||||
tasklistconstants.h \
|
tasklistconstants.h \
|
||||||
stopmonitoringhandler.h \
|
stopmonitoringhandler.h \
|
||||||
taskfile.h \
|
taskfile.h \
|
||||||
taskfilefactory.h \
|
|
||||||
|
|
||||||
SOURCES += tasklistplugin.cpp \
|
SOURCES += tasklistplugin.cpp \
|
||||||
stopmonitoringhandler.cpp \
|
stopmonitoringhandler.cpp \
|
||||||
taskfile.cpp \
|
taskfile.cpp \
|
||||||
taskfilefactory.cpp \
|
|
||||||
|
|
||||||
RESOURCES += tasklist.qrc
|
RESOURCES += tasklist.qrc
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ QtcPlugin {
|
|||||||
"stopmonitoringhandler.h",
|
"stopmonitoringhandler.h",
|
||||||
"taskfile.cpp",
|
"taskfile.cpp",
|
||||||
"taskfile.h",
|
"taskfile.h",
|
||||||
"taskfilefactory.cpp",
|
|
||||||
"taskfilefactory.h",
|
|
||||||
"tasklist.qrc",
|
"tasklist.qrc",
|
||||||
"tasklistconstants.h",
|
"tasklistconstants.h",
|
||||||
"tasklistplugin.cpp",
|
"tasklistplugin.cpp",
|
||||||
|
|||||||
@@ -31,10 +31,11 @@
|
|||||||
|
|
||||||
#include "stopmonitoringhandler.h"
|
#include "stopmonitoringhandler.h"
|
||||||
#include "taskfile.h"
|
#include "taskfile.h"
|
||||||
#include "taskfilefactory.h"
|
|
||||||
#include "tasklistconstants.h"
|
#include "tasklistconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
#include <coreplugin/idocumentfactory.h>
|
||||||
|
#include <coreplugin/documentmanager.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
@@ -43,16 +44,20 @@
|
|||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace TaskList::Internal;
|
|
||||||
|
|
||||||
static const char SESSION_FILE_KEY[] = "TaskList.File";
|
static const char SESSION_FILE_KEY[] = "TaskList.File";
|
||||||
static const char SESSION_BASE_KEY[] = "TaskList.BaseDir";
|
static const char SESSION_BASE_KEY[] = "TaskList.BaseDir";
|
||||||
|
|
||||||
namespace TaskList {
|
namespace TaskList {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
static TaskListPlugin *m_instance;
|
||||||
|
|
||||||
static Task::TaskType typeFrom(const QString &typeName)
|
static Task::TaskType typeFrom(const QString &typeName)
|
||||||
{
|
{
|
||||||
@@ -160,7 +165,35 @@ static bool parseTaskFile(QString *errorString, const QString &base, const QStri
|
|||||||
// TaskListPlugin
|
// TaskListPlugin
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
static TaskFileFactory *m_fileFactory = 0;
|
Core::IDocument *TaskListPlugin::openTasks(const QString &base, const QString &fileName)
|
||||||
|
{
|
||||||
|
foreach (TaskFile *doc, m_openFiles) {
|
||||||
|
if (doc->filePath() == fileName)
|
||||||
|
return doc;
|
||||||
|
}
|
||||||
|
|
||||||
|
TaskFile *file = new TaskFile(this);
|
||||||
|
file->setBaseDir(base);
|
||||||
|
|
||||||
|
QString errorString;
|
||||||
|
if (!file->open(&errorString, fileName)) {
|
||||||
|
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), errorString);
|
||||||
|
delete file;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_openFiles.append(file);
|
||||||
|
|
||||||
|
// Register with filemanager:
|
||||||
|
Core::DocumentManager::addDocument(file);
|
||||||
|
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
TaskListPlugin::TaskListPlugin()
|
||||||
|
{
|
||||||
|
m_instance = this;
|
||||||
|
}
|
||||||
|
|
||||||
bool TaskListPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
bool TaskListPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
{
|
{
|
||||||
@@ -172,7 +205,15 @@ bool TaskListPlugin::initialize(const QStringList &arguments, QString *errorMess
|
|||||||
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":tasklist/TaskList.mimetypes.xml"), errorMessage))
|
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":tasklist/TaskList.mimetypes.xml"), errorMessage))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_fileFactory = new TaskFileFactory(this);
|
m_fileFactory = new IDocumentFactory;
|
||||||
|
m_fileFactory->setId("ProjectExplorer.TaskFileFactory");
|
||||||
|
m_fileFactory->setDisplayName(tr("Task file reader"));
|
||||||
|
m_fileFactory->addMimeType(QLatin1String("text/x-tasklist"));
|
||||||
|
m_fileFactory->setOpener([this](const QString &fileName) -> IDocument * {
|
||||||
|
ProjectExplorer::Project *project = ProjectExplorer::ProjectExplorerPlugin::currentProject();
|
||||||
|
return this->openTasks(project ? project->projectDirectory().toString() : QString(), fileName);
|
||||||
|
});
|
||||||
|
|
||||||
addAutoReleasedObject(m_fileFactory);
|
addAutoReleasedObject(m_fileFactory);
|
||||||
addAutoReleasedObject(new StopMonitoringHandler);
|
addAutoReleasedObject(new StopMonitoringHandler);
|
||||||
|
|
||||||
@@ -202,7 +243,9 @@ void TaskListPlugin::stopMonitoring()
|
|||||||
SessionManager::setValue(QLatin1String(SESSION_BASE_KEY), QString());
|
SessionManager::setValue(QLatin1String(SESSION_BASE_KEY), QString());
|
||||||
SessionManager::setValue(QLatin1String(SESSION_FILE_KEY), QString());
|
SessionManager::setValue(QLatin1String(SESSION_FILE_KEY), QString());
|
||||||
|
|
||||||
m_fileFactory->closeAllFiles();
|
foreach (TaskFile *document, m_instance->m_openFiles)
|
||||||
|
document->deleteLater();
|
||||||
|
m_instance->m_openFiles.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskListPlugin::clearTasks()
|
void TaskListPlugin::clearTasks()
|
||||||
@@ -215,9 +258,10 @@ void TaskListPlugin::loadDataFromSession()
|
|||||||
const QString fileName = SessionManager::value(QLatin1String(SESSION_FILE_KEY)).toString();
|
const QString fileName = SessionManager::value(QLatin1String(SESSION_FILE_KEY)).toString();
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
return;
|
return;
|
||||||
m_fileFactory->open(SessionManager::value(QLatin1String(SESSION_BASE_KEY)).toString(), fileName);
|
openTasks(SessionManager::value(QLatin1String(SESSION_BASE_KEY)).toString(), fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
} // namespace TaskList
|
} // namespace TaskList
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(TaskList::TaskListPlugin)
|
Q_EXPORT_PLUGIN(TaskList::Internal::TaskListPlugin)
|
||||||
|
|||||||
@@ -30,11 +30,13 @@
|
|||||||
#ifndef TASKLISTPLUGIN_H
|
#ifndef TASKLISTPLUGIN_H
|
||||||
#define TASKLISTPLUGIN_H
|
#define TASKLISTPLUGIN_H
|
||||||
|
|
||||||
|
#include <coreplugin/idocumentfactory.h>
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
namespace ProjectExplorer { class Project; }
|
|
||||||
|
|
||||||
namespace TaskList {
|
namespace TaskList {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class TaskFile;
|
||||||
|
|
||||||
class TaskListPlugin : public ExtensionSystem::IPlugin
|
class TaskListPlugin : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
@@ -42,6 +44,8 @@ class TaskListPlugin : public ExtensionSystem::IPlugin
|
|||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "TaskList.json")
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "TaskList.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
TaskListPlugin();
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *errorMessage);
|
bool initialize(const QStringList &arguments, QString *errorMessage);
|
||||||
void extensionsInitialized() {}
|
void extensionsInitialized() {}
|
||||||
|
|
||||||
@@ -50,10 +54,17 @@ public:
|
|||||||
static void stopMonitoring();
|
static void stopMonitoring();
|
||||||
static void clearTasks();
|
static void clearTasks();
|
||||||
|
|
||||||
|
Core::IDocument *openTasks(const QString &base, const QString &fileName);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void loadDataFromSession();
|
void loadDataFromSession();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Core::IDocumentFactory *m_fileFactory;
|
||||||
|
QList<TaskFile *> m_openFiles;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
} // namespace TaskList
|
} // namespace TaskList
|
||||||
|
|
||||||
#endif // TASKLISTPLUGIN_H
|
#endif // TASKLISTPLUGIN_H
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ bool AddDebuggerOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int AddDebuggerOperation::execute() const
|
int AddDebuggerOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("debuggers"));
|
QVariantMap map = load(QLatin1String("Debuggers"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
map = initializeDebuggers();
|
map = initializeDebuggers();
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ int AddDebuggerOperation::execute() const
|
|||||||
if (result.isEmpty() || map == result)
|
if (result.isEmpty() || map == result)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("debuggers")) ? 0 : 3;
|
return save(result, QLatin1String("Debuggers")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ const char DEVICE_LIST_ID[] = "DeviceList";
|
|||||||
|
|
||||||
const char DEVICE_ID_ID[] = "InternalId";
|
const char DEVICE_ID_ID[] = "InternalId";
|
||||||
|
|
||||||
|
static const char INTERNAL_DSEKTOP_DEVICE_ID[] = "Desktop Device";
|
||||||
|
|
||||||
AddDeviceOperation::AddDeviceOperation()
|
AddDeviceOperation::AddDeviceOperation()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@@ -255,7 +257,7 @@ bool AddDeviceOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int AddDeviceOperation::execute() const
|
int AddDeviceOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("devices"));
|
QVariantMap map = load(QLatin1String("Devices"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
map = initializeDevices();
|
map = initializeDevices();
|
||||||
|
|
||||||
@@ -267,7 +269,7 @@ int AddDeviceOperation::execute() const
|
|||||||
if (result.isEmpty() || map == result)
|
if (result.isEmpty() || map == result)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("devices")) ? 0 : 3;
|
return save(result, QLatin1String("Devices")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
@@ -371,12 +373,14 @@ QVariantMap AddDeviceOperation::initializeDevices()
|
|||||||
|
|
||||||
bool AddDeviceOperation::exists(const QString &id)
|
bool AddDeviceOperation::exists(const QString &id)
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("device"));
|
QVariantMap map = load(QLatin1String("Devices"));
|
||||||
return exists(map, id);
|
return exists(map, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AddDeviceOperation::exists(const QVariantMap &map, const QString &id)
|
bool AddDeviceOperation::exists(const QVariantMap &map, const QString &id)
|
||||||
{
|
{
|
||||||
|
if (id == QLatin1String(INTERNAL_DSEKTOP_DEVICE_ID))
|
||||||
|
return true;
|
||||||
QVariantMap dmMap = map.value(QLatin1String(DEVICEMANAGER_ID)).toMap();
|
QVariantMap dmMap = map.value(QLatin1String(DEVICEMANAGER_ID)).toMap();
|
||||||
QVariantList devList = dmMap.value(QLatin1String(DEVICE_LIST_ID)).toList();
|
QVariantList devList = dmMap.value(QLatin1String(DEVICE_LIST_ID)).toList();
|
||||||
foreach (const QVariant &dev, devList) {
|
foreach (const QVariant &dev, devList) {
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ bool AddKitOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int AddKitOperation::execute() const
|
int AddKitOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("profiles"));
|
QVariantMap map = load(QLatin1String("Profiles"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
map = initializeKits();
|
map = initializeKits();
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ int AddKitOperation::execute() const
|
|||||||
if (result.isEmpty() || map == result)
|
if (result.isEmpty() || map == result)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("profiles")) ? 0 : 3;
|
return save(result, QLatin1String("Profiles")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
@@ -510,9 +510,9 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map,
|
|||||||
const QString &sysRoot, const QString &tc, const QString &qt,
|
const QString &sysRoot, const QString &tc, const QString &qt,
|
||||||
const QString &mkspec, const KeyValuePairList &extra)
|
const QString &mkspec, const KeyValuePairList &extra)
|
||||||
{
|
{
|
||||||
QVariantMap tcMap = load(QLatin1String("toolchains"));
|
QVariantMap tcMap = load(QLatin1String("ToolChains"));
|
||||||
QVariantMap qtMap = load(QLatin1String("qtversions"));
|
QVariantMap qtMap = load(QLatin1String("QtVersions"));
|
||||||
QVariantMap devMap = load(QLatin1String("devices"));
|
QVariantMap devMap = load(QLatin1String("Devices"));
|
||||||
|
|
||||||
return addKit(map, tcMap, qtMap, devMap, id, displayName, icon, debuggerId, debuggerType,
|
return addKit(map, tcMap, qtMap, devMap, id, displayName, icon, debuggerId, debuggerType,
|
||||||
debugger, deviceType, device, sysRoot, tc, qt, mkspec, extra);
|
debugger, deviceType, device, sysRoot, tc, qt, mkspec, extra);
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ bool AddQtOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int AddQtOperation::execute() const
|
int AddQtOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("qtversions"));
|
QVariantMap map = load(QLatin1String("QtVersions"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
map = initializeQtVersions();
|
map = initializeQtVersions();
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ int AddQtOperation::execute() const
|
|||||||
if (result.isEmpty() || result == map)
|
if (result.isEmpty() || result == map)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("qtversions")) ? 0 : 3;
|
return save(result, QLatin1String("QtVersions")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
@@ -315,7 +315,7 @@ QVariantMap AddQtOperation::initializeQtVersions()
|
|||||||
|
|
||||||
bool AddQtOperation::exists(const QString &id)
|
bool AddQtOperation::exists(const QString &id)
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("qtversion"));
|
QVariantMap map = load(QLatin1String("QtVersions"));
|
||||||
return exists(map, id);
|
return exists(map, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ bool AddToolChainOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int AddToolChainOperation::execute() const
|
int AddToolChainOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("toolchains"));
|
QVariantMap map = load(QLatin1String("ToolChains"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
map = initializeToolChains();
|
map = initializeToolChains();
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ int AddToolChainOperation::execute() const
|
|||||||
if (result.isEmpty() || map == result)
|
if (result.isEmpty() || map == result)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("toolchains")) ? 0 : 3;
|
return save(result, QLatin1String("ToolChains")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
@@ -291,6 +291,6 @@ bool AddToolChainOperation::exists(const QVariantMap &map, const QString &id)
|
|||||||
|
|
||||||
bool AddToolChainOperation::exists(const QString &id)
|
bool AddToolChainOperation::exists(const QString &id)
|
||||||
{
|
{
|
||||||
QVariantMap map = Operation::load(QLatin1String("toolchains"));
|
QVariantMap map = Operation::load(QLatin1String("ToolChains"));
|
||||||
return exists(map, id);
|
return exists(map, id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,8 +128,8 @@ bool Operation::save(const QVariantMap &map, const QString &file) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utils::PersistentSettingsWriter writer(path, QLatin1String("QtCreator")
|
||||||
Utils::PersistentSettingsWriter writer(path, QLatin1String("unknown"));
|
+ file[0].toUpper() + file.mid(1));
|
||||||
return writer.save(map, 0)
|
return writer.save(map, 0)
|
||||||
&& QFile::setPermissions(path.toString(),
|
&& QFile::setPermissions(path.toString(),
|
||||||
QFile::ReadOwner | QFile::WriteOwner
|
QFile::ReadOwner | QFile::WriteOwner
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ bool RmDebuggerOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int RmDebuggerOperation::execute() const
|
int RmDebuggerOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("debuggers"));
|
QVariantMap map = load(QLatin1String("Debuggers"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
map = AddDebuggerOperation::initializeDebuggers();
|
map = AddDebuggerOperation::initializeDebuggers();
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ int RmDebuggerOperation::execute() const
|
|||||||
if (result == map)
|
if (result == map)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("debuggers")) ? 0 : 3;
|
return save(result, QLatin1String("Debuggers")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ bool RmDeviceOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int RmDeviceOperation::execute() const
|
int RmDeviceOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("devices"));
|
QVariantMap map = load(QLatin1String("Devices"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
map = AddDeviceOperation::initializeDevices();
|
map = AddDeviceOperation::initializeDevices();
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ int RmDeviceOperation::execute() const
|
|||||||
if (result == map)
|
if (result == map)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("devices")) ? 0 : 3;
|
return save(result, QLatin1String("Devices")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ bool RmKitOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int RmKitOperation::execute() const
|
int RmKitOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("profiles"));
|
QVariantMap map = load(QLatin1String("Profiles"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
map = AddKitOperation::initializeKits();
|
map = AddKitOperation::initializeKits();
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ int RmKitOperation::execute() const
|
|||||||
if (result == map)
|
if (result == map)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("profiles")) ? 0 : 3;
|
return save(result, QLatin1String("Profiles")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ bool RmQtOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int RmQtOperation::execute() const
|
int RmQtOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("qtversion"));
|
QVariantMap map = load(QLatin1String("QtVersions"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ int RmQtOperation::execute() const
|
|||||||
if (result == map)
|
if (result == map)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("qtversion")) ? 0 : 3;
|
return save(result, QLatin1String("QtVersions")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ bool RmToolChainOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
int RmToolChainOperation::execute() const
|
int RmToolChainOperation::execute() const
|
||||||
{
|
{
|
||||||
QVariantMap map = load(QLatin1String("toolchains"));
|
QVariantMap map = load(QLatin1String("ToolChains"));
|
||||||
if (map.isEmpty())
|
if (map.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ int RmToolChainOperation::execute() const
|
|||||||
if (result == map)
|
if (result == map)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return save(result, QLatin1String("toolchains")) ? 0 : 3;
|
return save(result, QLatin1String("ToolChains")) ? 0 : 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
|||||||
@@ -61,18 +61,20 @@ Settings::Settings() :
|
|||||||
Utils::FileName Settings::getPath(const QString &file)
|
Utils::FileName Settings::getPath(const QString &file)
|
||||||
{
|
{
|
||||||
Utils::FileName result = sdkPath;
|
Utils::FileName result = sdkPath;
|
||||||
if (file == QLatin1String("profiles") || file == QLatin1String("kits"))
|
const QString lowerFile = file.toLower();
|
||||||
|
const QStringList identical = QStringList()
|
||||||
|
<< QLatin1String("profiles")
|
||||||
|
<< QLatin1String("qtversion")
|
||||||
|
<< QLatin1String("toolchains")
|
||||||
|
<< QLatin1String("devices")
|
||||||
|
<< QLatin1String("android")
|
||||||
|
<< QLatin1String("debuggers");
|
||||||
|
if (lowerFile == QLatin1String("kits"))
|
||||||
result.appendPath(QLatin1String("profiles"));
|
result.appendPath(QLatin1String("profiles"));
|
||||||
else if (file == QLatin1String("qtversions") || file == QLatin1String("qtversion"))
|
else if (lowerFile == QLatin1String("qtversions"))
|
||||||
result.appendPath(QLatin1String("qtversion"));
|
result.appendPath(QLatin1String("qtversion"));
|
||||||
else if (file == QLatin1String("toolchains") || file == QLatin1String("toolChains"))
|
else if (identical.contains(lowerFile))
|
||||||
result.appendPath(QLatin1String("toolchains"));
|
result.appendPath(lowerFile);
|
||||||
else if (file == QLatin1String("devices"))
|
|
||||||
result.appendPath(QLatin1String("devices"));
|
|
||||||
else if (file == QLatin1String("android"))
|
|
||||||
result.appendPath(QLatin1String("android"));
|
|
||||||
else if (file == QLatin1String("debuggers"))
|
|
||||||
result.appendPath(QLatin1String("debuggers"));
|
|
||||||
else
|
else
|
||||||
return Utils::FileName();
|
return Utils::FileName();
|
||||||
result.appendString(QLatin1String(".xml"));
|
result.appendString(QLatin1String(".xml"));
|
||||||
|
|||||||
Reference in New Issue
Block a user