Commit a7e2d0cf authored by Eike Ziller's avatar Eike Ziller Committed by The Qt Project

Merge "Merge remote-tracking branch 'origin/4.4'"

parents 906e2312 3d9cf954
...@@ -1177,7 +1177,7 @@ class DumperBase: ...@@ -1177,7 +1177,7 @@ class DumperBase:
n = arrayByteSize // innerType.size() n = arrayByteSize // innerType.size()
p = value.address() p = value.address()
if displayFormat != RawFormat and p: if displayFormat != RawFormat and p:
if innerType.name in ('char', 'wchar_t', 'unsigned char', 'signed char'): if innerType.name in ('char', 'wchar_t', 'unsigned char', 'signed char', 'CHAR', 'WCHAR'):
self.putCharArrayHelper(p, n, innerType, self.currentItemFormat(), self.putCharArrayHelper(p, n, innerType, self.currentItemFormat(),
makeExpandable = False) makeExpandable = False)
else: else:
...@@ -1256,7 +1256,7 @@ class DumperBase: ...@@ -1256,7 +1256,7 @@ class DumperBase:
# This is shared by pointer and array formatting. # This is shared by pointer and array formatting.
def tryPutSimpleFormattedPointer(self, ptr, typeName, innerType, displayFormat, limit): def tryPutSimpleFormattedPointer(self, ptr, typeName, innerType, displayFormat, limit):
if displayFormat == AutomaticFormat: if displayFormat == AutomaticFormat:
if innerType.name in ('char', 'signed char', 'unsigned char'): if innerType.name in ('char', 'signed char', 'unsigned char', 'CHAR'):
# Use UTF-8 as default for char *. # Use UTF-8 as default for char *.
self.putType(typeName) self.putType(typeName)
(elided, shown, data) = self.readToFirstZero(ptr, 1, limit) (elided, shown, data) = self.readToFirstZero(ptr, 1, limit)
...@@ -1265,7 +1265,7 @@ class DumperBase: ...@@ -1265,7 +1265,7 @@ class DumperBase:
self.putArrayData(ptr, shown, innerType) self.putArrayData(ptr, shown, innerType)
return True return True
if innerType.name == 'wchar_t': if innerType.name in ('wchar_t', 'WCHAR'):
self.putType(typeName) self.putType(typeName)
charSize = self.lookupType('wchar_t').size() charSize = self.lookupType('wchar_t').size()
(elided, data) = self.encodeCArray(ptr, charSize, limit) (elided, data) = self.encodeCArray(ptr, charSize, limit)
...@@ -1415,7 +1415,7 @@ class DumperBase: ...@@ -1415,7 +1415,7 @@ class DumperBase:
#warn('INNER: %s' % innerType.name) #warn('INNER: %s' % innerType.name)
if self.autoDerefPointers: if self.autoDerefPointers:
# Generic pointer type with AutomaticFormat, but never dereference char types: # Generic pointer type with AutomaticFormat, but never dereference char types:
if innerType.name not in ('char', 'signed char', 'unsigned char', 'wchar_t'): if innerType.name not in ('char', 'signed char', 'unsigned char', 'wchar_t', 'CHAR', 'WCHAR'):
self.putDerefedPointer(value) self.putDerefedPointer(value)
return return
......
...@@ -1062,6 +1062,11 @@ class Dumper(DumperBase): ...@@ -1062,6 +1062,11 @@ class Dumper(DumperBase):
cmd = 'set variable (%s)=%s' % (expr, value) cmd = 'set variable (%s)=%s' % (expr, value)
gdb.execute(cmd) gdb.execute(cmd)
def appendSolibSearchPath(self, args):
new = list(map(self.hexdecode, args['path']))
old = [gdb.parameter('solib-search-path')]
gdb.execute('set solib-search-path %s' % args['separator'].join(old + new))
def watchPoint(self, args): def watchPoint(self, args):
self.reportToken(args) self.reportToken(args)
ns = self.qtNamespace() ns = self.qtNamespace()
......
...@@ -255,8 +255,8 @@ static inline int classify5(const char *s, LanguageFeatures features) ...@@ -255,8 +255,8 @@ static inline int classify5(const char *s, LanguageFeatures features)
} }
} }
} }
else if (features.cxxEnabled && s[0] == 'f') { else if (s[0] == 'f') {
if (s[1] == 'a') { if (features.cxxEnabled && s[1] == 'a') {
if (s[2] == 'l') { if (s[2] == 'l') {
if (s[3] == 's') { if (s[3] == 's') {
if (s[4] == 'e') { if (s[4] == 'e') {
......
...@@ -106,7 +106,11 @@ Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original) ...@@ -106,7 +106,11 @@ Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
, _initializer(clone->stringLiteral(original->_initializer)) , _initializer(clone->stringLiteral(original->_initializer))
{ {
const char* nameId = nullptr; const char* nameId = nullptr;
if (const Identifier* identifier = name()->identifier()) const Name *theName = name();
if (!theName)
return;
if (const Identifier* identifier = theName->identifier())
nameId = identifier->chars(); nameId = identifier->chars();
else else
return; return;
......
...@@ -57,7 +57,9 @@ void WriteMessageBlock::write(const MessageEnvelop &message) ...@@ -57,7 +57,9 @@ void WriteMessageBlock::write(const MessageEnvelop &message)
++m_messageCounter; ++m_messageCounter;
m_ioDevice->write(block); const qint64 bytesWritten = m_ioDevice->write(block);
if (bytesWritten == -1)
qWarning() << "Failed to write data:" << m_ioDevice->errorString();
} }
qint64 WriteMessageBlock::counter() const qint64 WriteMessageBlock::counter() const
......
...@@ -353,7 +353,7 @@ static const Terminal knownTerminals[] = ...@@ -353,7 +353,7 @@ static const Terminal knownTerminals[] =
{"urxvt", "-e"}, {"urxvt", "-e"},
{"xfce4-terminal", "-x"}, {"xfce4-terminal", "-x"},
{"konsole", "-e"}, {"konsole", "-e"},
{"gnome-terminal", "-x"} {"gnome-terminal", "--"}
}; };
QString ConsoleProcess::defaultTerminalEmulator() QString ConsoleProcess::defaultTerminalEmulator()
......
...@@ -309,7 +309,7 @@ static void processOutput(TestOutputReader *outputreader, const QString &msg, ...@@ -309,7 +309,7 @@ static void processOutput(TestOutputReader *outputreader, const QString &msg,
break; break;
} }
for (const QString &line : msg.mid(start).split('\n')) for (const QString &line : msg.mid(start).split('\n'))
outputreader->processOutput(line.toUtf8() + '\n'); outputreader->processOutput(line.toUtf8());
break; break;
} }
case Utils::OutputFormat::StdErrFormatSameLine: case Utils::OutputFormat::StdErrFormatSameLine:
......
...@@ -154,8 +154,14 @@ static QList<CMakeTool *> autoDetectCMakeTools() ...@@ -154,8 +154,14 @@ static QList<CMakeTool *> autoDetectCMakeTools()
path.removeDuplicates(); path.removeDuplicates();
if (HostOsInfo::isWindowsHost()) { if (HostOsInfo::isWindowsHost()) {
path.append("C:/Program Files/CMake"); const QString progFiles = QLatin1String(qgetenv("ProgramFiles"));
path.append("C:/Program Files (x86)/CMake"); path.append(progFiles + "/CMake");
path.append(progFiles + "/CMake/bin");
const QString progFilesX86 = QLatin1String(qgetenv("ProgramFiles(x86)"));
if (!progFilesX86.isEmpty()) {
path.append(progFilesX86 + "/CMake");
path.append(progFilesX86 + "/CMake/bin");
}
} }
if (HostOsInfo::isMacHost()) { if (HostOsInfo::isMacHost()) {
......
...@@ -249,7 +249,7 @@ CMakeConfig ServerModeReader::takeParsedConfiguration() ...@@ -249,7 +249,7 @@ CMakeConfig ServerModeReader::takeParsedConfiguration()
} }
static void addCMakeVFolder(FolderNode *base, const Utils::FileName &basePath, int priority, static void addCMakeVFolder(FolderNode *base, const Utils::FileName &basePath, int priority,
const QString &displayName, QList<FileNode *> &files) const QString &displayName, const QList<FileNode *> &files)
{ {
if (files.isEmpty()) if (files.isEmpty())
return; return;
...@@ -264,6 +264,17 @@ static void addCMakeVFolder(FolderNode *base, const Utils::FileName &basePath, i ...@@ -264,6 +264,17 @@ static void addCMakeVFolder(FolderNode *base, const Utils::FileName &basePath, i
fn->compress(); fn->compress();
} }
static QList<FileNode *> removeKnownNodes(const QSet<Utils::FileName> &knownFiles, const QList<FileNode *> &files)
{
return Utils::filtered(files, [&knownFiles](const FileNode *n) {
if (knownFiles.contains(n->filePath())) {
delete n;
return false;
}
return true;
});
}
static void addCMakeInputs(FolderNode *root, static void addCMakeInputs(FolderNode *root,
const Utils::FileName &sourceDir, const Utils::FileName &sourceDir,
const Utils::FileName &buildDir, const Utils::FileName &buildDir,
...@@ -274,13 +285,19 @@ static void addCMakeInputs(FolderNode *root, ...@@ -274,13 +285,19 @@ static void addCMakeInputs(FolderNode *root,
ProjectNode *cmakeVFolder = new CMakeInputsNode(root->filePath()); ProjectNode *cmakeVFolder = new CMakeInputsNode(root->filePath());
root->addNode(cmakeVFolder); root->addNode(cmakeVFolder);
addCMakeVFolder(cmakeVFolder, sourceDir, 1000, QString(), sourceInputs); QSet<Utils::FileName> knownFiles;
root->forEachGenericNode([&knownFiles](const Node *n) {
if (n->listInProject())
knownFiles.insert(n->filePath());
});
addCMakeVFolder(cmakeVFolder, sourceDir, 1000, QString(), removeKnownNodes(knownFiles, sourceInputs));
addCMakeVFolder(cmakeVFolder, buildDir, 100, addCMakeVFolder(cmakeVFolder, buildDir, 100,
QCoreApplication::translate("CMakeProjectManager::Internal::ServerModeReader", "<Build Directory>"), QCoreApplication::translate("CMakeProjectManager::Internal::ServerModeReader", "<Build Directory>"),
buildInputs); removeKnownNodes(knownFiles, buildInputs));
addCMakeVFolder(cmakeVFolder, Utils::FileName(), 10, addCMakeVFolder(cmakeVFolder, Utils::FileName(), 10,
QCoreApplication::translate("CMakeProjectManager::Internal::ServerModeReader", "<Other Locations>"), QCoreApplication::translate("CMakeProjectManager::Internal::ServerModeReader", "<Other Locations>"),
rootInputs); removeKnownNodes(knownFiles, rootInputs));
} }
void ServerModeReader::generateProjectTree(CMakeProjectNode *root, void ServerModeReader::generateProjectTree(CMakeProjectNode *root,
...@@ -311,15 +328,15 @@ void ServerModeReader::generateProjectTree(CMakeProjectNode *root, ...@@ -311,15 +328,15 @@ void ServerModeReader::generateProjectTree(CMakeProjectNode *root,
if (topLevel) if (topLevel)
root->setDisplayName(topLevel->name); root->setDisplayName(topLevel->name);
if (!cmakeFilesSource.isEmpty() || !cmakeFilesBuild.isEmpty() || !cmakeFilesOther.isEmpty())
addCMakeInputs(root, m_parameters.sourceDirectory, m_parameters.buildDirectory,
cmakeFilesSource, cmakeFilesBuild, cmakeFilesOther);
QHash<Utils::FileName, ProjectNode *> cmakeListsNodes = addCMakeLists(root, cmakeLists); QHash<Utils::FileName, ProjectNode *> cmakeListsNodes = addCMakeLists(root, cmakeLists);
QList<FileNode *> knownHeaders; QList<FileNode *> knownHeaders;
addProjects(cmakeListsNodes, m_projects, knownHeaders); addProjects(cmakeListsNodes, m_projects, knownHeaders);
addHeaderNodes(root, knownHeaders, allFiles); addHeaderNodes(root, knownHeaders, allFiles);
if (!cmakeFilesSource.isEmpty() || !cmakeFilesBuild.isEmpty() || !cmakeFilesOther.isEmpty())
addCMakeInputs(root, m_parameters.sourceDirectory, m_parameters.buildDirectory,
cmakeFilesSource, cmakeFilesBuild, cmakeFilesOther);
} }
void ServerModeReader::updateCodeModel(CppTools::RawProjectParts &rpps) void ServerModeReader::updateCodeModel(CppTools::RawProjectParts &rpps)
......
...@@ -4443,9 +4443,12 @@ void GdbEngine::setupInferior() ...@@ -4443,9 +4443,12 @@ void GdbEngine::setupInferior()
// if (!remoteArch.isEmpty()) // if (!remoteArch.isEmpty())
// postCommand("set architecture " + remoteArch); // postCommand("set architecture " + remoteArch);
const QString solibSearchPath = rp.solibSearchPath.join(HostOsInfo::pathListSeparator()); if (!rp.solibSearchPath.isEmpty()) {
if (!solibSearchPath.isEmpty()) DebuggerCommand cmd("appendSolibSearchPath");
runCommand({"set solib-search-path " + solibSearchPath}); cmd.arg("path", rp.solibSearchPath);
cmd.arg("separator", HostOsInfo::pathListSeparator());
runCommand(cmd);
}
if (!args.isEmpty()) if (!args.isEmpty())
runCommand({"-exec-arguments " + args}); runCommand({"-exec-arguments " + args});
......
...@@ -4422,7 +4422,7 @@ bool FakeVimHandler::Private::handleNoSubMode(const Input &input) ...@@ -4422,7 +4422,7 @@ bool FakeVimHandler::Private::handleNoSubMode(const Input &input)
} else if (g.gflag && input.is('t')) { } else if (g.gflag && input.is('t')) {
handleExCommand("tabnext"); handleExCommand("tabnext");
} else if (g.gflag && input.is('T')) { } else if (g.gflag && input.is('T')) {
handleExCommand("tabprev"); handleExCommand("tabprevious");
} else if (input.isControl('t')) { } else if (input.isControl('t')) {
handleExCommand("pop"); handleExCommand("pop");
} else if (!g.gflag && input.is('u') && !isVisualMode()) { } else if (!g.gflag && input.is('u') && !isVisualMode()) {
...@@ -5565,7 +5565,7 @@ bool FakeVimHandler::Private::handleExSubstituteCommand(const ExCommand &cmd) ...@@ -5565,7 +5565,7 @@ bool FakeVimHandler::Private::handleExSubstituteCommand(const ExCommand &cmd)
bool FakeVimHandler::Private::handleExTabNextCommand(const ExCommand &cmd) bool FakeVimHandler::Private::handleExTabNextCommand(const ExCommand &cmd)
{ {
if (cmd.cmd != "tabnext" && cmd.cmd != "tabn") if (!cmd.matches("tabn", "tabnext"))
return false; return false;
emit q->tabNextRequested(q); emit q->tabNextRequested(q);
...@@ -5574,7 +5574,7 @@ bool FakeVimHandler::Private::handleExTabNextCommand(const ExCommand &cmd) ...@@ -5574,7 +5574,7 @@ bool FakeVimHandler::Private::handleExTabNextCommand(const ExCommand &cmd)
bool FakeVimHandler::Private::handleExTabPreviousCommand(const ExCommand &cmd) bool FakeVimHandler::Private::handleExTabPreviousCommand(const ExCommand &cmd)
{ {
if (cmd.cmd != "tabprevious" && cmd.cmd != "tabp") if (!cmd.matches("tabp", "tabprevious"))
return false; return false;
emit q->tabPreviousRequested(q); emit q->tabPreviousRequested(q);
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "gerritpushdialog.h" #include "gerritpushdialog.h"
#include "ui_gerritpushdialog.h" #include "ui_gerritpushdialog.h"
#include "branchcombobox.h" #include "branchcombobox.h"
#include "gerritserver.h"
#include "../gitplugin.h" #include "../gitplugin.h"
#include "../gitclient.h" #include "../gitclient.h"
...@@ -129,6 +128,7 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev ...@@ -129,6 +128,7 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev
m_ui->repositoryLabel->setText(QDir::toNativeSeparators(workingDir)); m_ui->repositoryLabel->setText(QDir::toNativeSeparators(workingDir));
m_ui->remoteComboBox->setRepository(workingDir); m_ui->remoteComboBox->setRepository(workingDir);
m_ui->remoteComboBox->setParameters(parameters); m_ui->remoteComboBox->setParameters(parameters);
m_ui->remoteComboBox->setAllowDups(true);
PushItemDelegate *delegate = new PushItemDelegate(m_ui->commitView); PushItemDelegate *delegate = new PushItemDelegate(m_ui->commitView);
delegate->setParent(this); delegate->setParent(this);
......
...@@ -80,6 +80,11 @@ void GerritRemoteChooser::setFallbackEnabled(bool value) ...@@ -80,6 +80,11 @@ void GerritRemoteChooser::setFallbackEnabled(bool value)
m_enableFallback = value; m_enableFallback = value;
} }
void GerritRemoteChooser::setAllowDups(bool value)
{
m_allowDups = value;
}
bool GerritRemoteChooser::setCurrentRemote(const QString &remoteName) bool GerritRemoteChooser::setCurrentRemote(const QString &remoteName)
{ {
for (int i = 0, total = m_remoteComboBox->count(); i < total; ++i) { for (int i = 0, total = m_remoteComboBox->count(); i < total; ++i) {
...@@ -118,9 +123,11 @@ bool GerritRemoteChooser::updateRemotes(bool forceReload) ...@@ -118,9 +123,11 @@ bool GerritRemoteChooser::updateRemotes(bool forceReload)
void GerritRemoteChooser::addRemote(const GerritServer &server, const QString &name) void GerritRemoteChooser::addRemote(const GerritServer &server, const QString &name)
{ {
for (auto remote : m_remotes) { if (!m_allowDups) {
if (remote.second == server) for (auto remote : m_remotes) {
return; if (remote.second == server)
return;
}
} }
m_remoteComboBox->addItem(server.host + QString(" (%1)").arg(name)); m_remoteComboBox->addItem(server.host + QString(" (%1)").arg(name));
m_remotes.push_back({ name, server }); m_remotes.push_back({ name, server });
......
...@@ -48,6 +48,7 @@ public: ...@@ -48,6 +48,7 @@ public:
void setRepository(const QString &repository); void setRepository(const QString &repository);
void setParameters(QSharedPointer<GerritParameters> parameters); void setParameters(QSharedPointer<GerritParameters> parameters);
void setFallbackEnabled(bool value); void setFallbackEnabled(bool value);
void setAllowDups(bool value);
bool setCurrentRemote(const QString &remoteName); bool setCurrentRemote(const QString &remoteName);
bool updateRemotes(bool forceReload); bool updateRemotes(bool forceReload);
...@@ -68,6 +69,7 @@ private: ...@@ -68,6 +69,7 @@ private:
QToolButton *m_resetRemoteButton = nullptr; QToolButton *m_resetRemoteButton = nullptr;
bool m_updatingRemotes = false; bool m_updatingRemotes = false;
bool m_enableFallback = false; bool m_enableFallback = false;
bool m_allowDups = false;
using NameAndServer = std::pair<QString, GerritServer>; using NameAndServer = std::pair<QString, GerritServer>;
std::vector<NameAndServer> m_remotes; std::vector<NameAndServer> m_remotes;
}; };
......
...@@ -629,6 +629,16 @@ void HelpPlugin::highlightSearchTermsInContextHelp() ...@@ -629,6 +629,16 @@ void HelpPlugin::highlightSearchTermsInContextHelp()
void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocation location) void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocation location)
{ {
static const QString qtcreatorUnversionedID = "org.qt-project.qtcreator";
if (url.host() == qtcreatorUnversionedID) {
// QtHelp doesn't know about versions, add the version number and use that
QUrl versioned = url;
versioned.setHost(qtcreatorUnversionedID + "."
+ QString::fromLatin1(Core::Constants::IDE_VERSION_LONG).remove('.'));
handleHelpRequest(versioned, location);
return;
}
if (HelpViewer::launchWithExternalApp(url)) if (HelpViewer::launchWithExternalApp(url))
return; return;
...@@ -639,7 +649,7 @@ void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocat ...@@ -639,7 +649,7 @@ void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocat
|| address.startsWith("qthelp://com.trolltech.")) { || address.startsWith("qthelp://com.trolltech.")) {
// local help not installed, resort to external web help // local help not installed, resort to external web help
QString urlPrefix = "http://doc.qt.io/"; QString urlPrefix = "http://doc.qt.io/";
if (url.authority() == "org.qt-project.qtcreator") if (url.authority().startsWith(qtcreatorUnversionedID))
urlPrefix.append(QString::fromLatin1("qtcreator")); urlPrefix.append(QString::fromLatin1("qtcreator"));
else else
urlPrefix.append("qt-5"); urlPrefix.append("qt-5");
......
...@@ -378,7 +378,9 @@ void ProjectTree::applyTreeManager(FolderNode *folder) ...@@ -378,7 +378,9 @@ void ProjectTree::applyTreeManager(FolderNode *folder)
bool ProjectTree::hasNode(const Node *node) bool ProjectTree::hasNode(const Node *node)
{ {
return Utils::contains(SessionManager::projects(), [node](const Project *p) { return Utils::contains(SessionManager::projects(), [node](const Project *p) {
return p && p->rootProjectNode() && p->rootProjectNode()->findNode([node](const Node *n) { return n == node; }); return p && p->rootProjectNode() && (
p->containerNode() == node
|| p->rootProjectNode()->findNode([node](const Node *n) { return n == node; }));
}); });
} }
......
...@@ -332,7 +332,7 @@ void MoveManipulator::clear() ...@@ -332,7 +332,7 @@ void MoveManipulator::clear()
m_beginVerticalCenterHash.clear(); m_beginVerticalCenterHash.clear();
} }
void MoveManipulator::reparentTo(FormEditorItem *newParent) void MoveManipulator::reparentTo(FormEditorItem *newParent, ReparentFlag flag)
{ {
deleteSnapLines(); deleteSnapLines();
...@@ -348,7 +348,8 @@ void MoveManipulator::reparentTo(FormEditorItem *newParent) ...@@ -348,7 +348,8 @@ void MoveManipulator::reparentTo(FormEditorItem *newParent)
&& newParent->qmlItemNode().modelNode().hasParentProperty()) { && newParent->qmlItemNode().modelNode().hasParentProperty()) {
ModelNode grandParent = newParent->qmlItemNode().modelNode().parentProperty().parentModelNode(); ModelNode grandParent = newParent->qmlItemNode().modelNode().parentProperty().parentModelNode();
if (grandParent.metaInfo().isLayoutable() if (grandParent.metaInfo().isLayoutable()
&& !NodeHints::fromModelNode(grandParent).isStackedContainer()) && !NodeHints::fromModelNode(grandParent).isStackedContainer()
&& flag == DoNotEnforceReparent)
newParent = m_view.data()->scene()->itemForQmlItemNode(QmlItemNode(grandParent)); newParent = m_view.data()->scene()->itemForQmlItemNode(QmlItemNode(grandParent));
} }
......
...@@ -48,6 +48,11 @@ public: ...@@ -48,6 +48,11 @@ public:
UseBaseState UseBaseState
}; };
enum ReparentFlag {
DoNotEnforceReparent,
EnforceReparent
};
MoveManipulator(LayerItem *layerItem, FormEditorView *view); MoveManipulator(LayerItem *layerItem, FormEditorView *view);
~MoveManipulator(); ~MoveManipulator();
void setItems(const QList<FormEditorItem*> &itemList); void setItems(const QList<FormEditorItem*> &itemList);
...@@ -57,7 +62,7 @@ public: ...@@ -57,7 +62,7 @@ public:
void begin(const QPointF& beginPoint); void begin(const QPointF& beginPoint);
void update(const QPointF& updatePoint, Snapper::Snapping useSnapping, State stateToBeManipulated = UseCurrentState); void update(const QPointF& updatePoint, Snapper::Snapping useSnapping, State stateToBeManipulated = UseCurrentState);
void reparentTo(FormEditorItem *newParent); void reparentTo(FormEditorItem *newParent, ReparentFlag flag = DoNotEnforceReparent);
void end(); void end();
void end(Snapper::Snapping useSnapping); void end(Snapper::Snapping useSnapping);
......
...@@ -113,7 +113,7 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList, ...@@ -113,7 +113,7 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
if (m_movingItems.count() > 1 if (m_movingItems.count() > 1
|| (movingItem->qmlItemNode().canBereparentedTo(containerItem->qmlItemNode()))) || (movingItem->qmlItemNode().canBereparentedTo(containerItem->qmlItemNode())))
m_moveManipulator.reparentTo(containerItem); m_moveManipulator.reparentTo(containerItem, MoveManipulator::EnforceReparent);
} }
} }
......
...@@ -71,13 +71,6 @@ void SelectionTool::mousePressEvent(const QList<QGraphicsItem*> &itemList, ...@@ -71,13 +71,6 @@ void SelectionTool::mousePressEvent(const QList<QGraphicsItem*> &itemList,
m_itemAlreadySelected = toQmlItemNodeList(view()->selectedModelNodes()).contains(formEditorItem->qmlItemNode()) m_itemAlreadySelected = toQmlItemNodeList(view()->selectedModelNodes()).contains(formEditorItem->qmlItemNode())
|| !view()->hasSingleSelectedModelNode(); || !view()->hasSingleSelectedModelNode();
if (event->modifiers().testFlag(Qt::ControlModifier))
m_singleSelectionManipulator.select(SingleSelectionManipulator::InvertSelection);
else if (event->modifiers().testFlag(Qt::ShiftModifier))
m_singleSelectionManipulator.select(SingleSelectionManipulator::InvertSelection);
else
m_singleSelectionManipulator.select(SingleSelectionManipulator::ReplaceSelection);
} else { } else {
if (event->modifiers().testFlag(Qt::AltModifier)) { if (event->modifiers().testFlag(Qt::AltModifier)) {
m_singleSelectionManipulator.begin(event->scenePos()); m_singleSelectionManipulator.begin(event->scenePos());
...@@ -168,6 +161,12 @@ void SelectionTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList, ...@@ -168,6 +161,12 @@ void SelectionTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
{ {
if (event->button() == Qt::LeftButton) { if (event->button() == Qt::LeftButton) {
if (m_singleSelectionManipulator.isActive()) { if (m_singleSelectionManipulator.isActive()) {
if (event->modifiers().testFlag(Qt::ControlModifier))
m_singleSelectionManipulator.select(SingleSelectionManipulator::InvertSelection);
else if (event->modifiers().testFlag(Qt::ShiftModifier))
m_singleSelectionManipulator.select(SingleSelectionManipulator::InvertSelection);
else
m_singleSelectionManipulator.select(SingleSelectionManipulator::ReplaceSelection);
m_singleSelectionManipulator.end(event->scenePos()); m_singleSelectionManipulator.end(event->scenePos());
} else if (m_rubberbandSelectionManipulator.isActive()) { } else if (m_rubberbandSelectionManipulator.isActive()) {
......
...@@ -53,6 +53,19 @@ bool JobQueue::add(const JobRequest &job) ...@@ -53,6 +53,19 @@ bool JobQueue::add(const JobRequest &job)
return false; return false;
} }
if (!m_documents.hasDocument(job.filePath, job.projectPartId)) {
qCDebug(jobsLog) << "Not adding / cancelling due to already closed document:" << job;
cancelJobRequest(job);