forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.10' into 4.11
Conflicts: src/plugins/projectexplorer/projectnodes.h Change-Id: I10a749cca38c2d0929cf4d2b74ab089e14b6157b
This commit is contained in:
@@ -101,8 +101,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
install(TARGETS OptionalSvg EXPORT QtCreator)
|
install(TARGETS OptionalSvg EXPORT QtCreator)
|
||||||
|
|
||||||
find_package(LLVM QUIET)
|
|
||||||
find_package(Clang COMPONENTS libclang QUIET)
|
find_package(Clang COMPONENTS libclang QUIET)
|
||||||
|
find_package(LLVM QUIET)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
find_library(FWCoreFoundation CoreFoundation)
|
find_library(FWCoreFoundation CoreFoundation)
|
||||||
|
@@ -523,6 +523,8 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.setDesktopFileName("org.qt-project.qtcreator.desktop");
|
||||||
|
|
||||||
// Make sure we honor the system's proxy settings
|
// Make sure we honor the system's proxy settings
|
||||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||||
|
|
||||||
|
@@ -174,7 +174,7 @@ CMakeTargetNode::CMakeTargetNode(const Utils::FilePath &directory, const QString
|
|||||||
setPriority(Node::DefaultProjectPriority + 900);
|
setPriority(Node::DefaultProjectPriority + 900);
|
||||||
setIcon(QIcon(":/projectexplorer/images/build.png")); // TODO: Use proper icon!
|
setIcon(QIcon(":/projectexplorer/images/build.png")); // TODO: Use proper icon!
|
||||||
setListInProject(false);
|
setListInProject(false);
|
||||||
setIsProduct();
|
setProductType(ProductType::Other);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CMakeTargetNode::tooltip() const
|
QString CMakeTargetNode::tooltip() const
|
||||||
|
@@ -117,7 +117,10 @@ OutputWindow::OutputWindow(Context context, const QString &settingsKey, QWidget
|
|||||||
connect(copyAction, &QAction::triggered, this, &QPlainTextEdit::copy);
|
connect(copyAction, &QAction::triggered, this, &QPlainTextEdit::copy);
|
||||||
connect(pasteAction, &QAction::triggered, this, &QPlainTextEdit::paste);
|
connect(pasteAction, &QAction::triggered, this, &QPlainTextEdit::paste);
|
||||||
connect(selectAllAction, &QAction::triggered, this, &QPlainTextEdit::selectAll);
|
connect(selectAllAction, &QAction::triggered, this, &QPlainTextEdit::selectAll);
|
||||||
connect(this, &QPlainTextEdit::blockCountChanged, this, &OutputWindow::filterNewContent);
|
connect(this, &QPlainTextEdit::blockCountChanged, this, [this] {
|
||||||
|
if (!d->filterText.isEmpty())
|
||||||
|
filterNewContent();
|
||||||
|
});
|
||||||
|
|
||||||
connect(this, &QPlainTextEdit::undoAvailable, undoAction, &QAction::setEnabled);
|
connect(this, &QPlainTextEdit::undoAvailable, undoAction, &QAction::setEnabled);
|
||||||
connect(this, &QPlainTextEdit::redoAvailable, redoAction, &QAction::setEnabled);
|
connect(this, &QPlainTextEdit::redoAvailable, redoAction, &QAction::setEnabled);
|
||||||
|
@@ -2288,15 +2288,20 @@ void WatchModel::showEditValue(const WatchItem *item)
|
|||||||
QTC_ASSERT(0 < nbytes && nbytes < 10000 * 10000, return);
|
QTC_ASSERT(0 < nbytes && nbytes < 10000 * 10000, return);
|
||||||
QTC_ASSERT(0 < imformat && imformat < 32, return);
|
QTC_ASSERT(0 < imformat && imformat < 32, return);
|
||||||
QImage im(width, height, QImage::Format(imformat));
|
QImage im(width, height, QImage::Format(imformat));
|
||||||
std::memcpy(im.bits(), bits, nbytes);
|
const qsizetype size = im.sizeInBytes();
|
||||||
auto v = m_separatedView->prepareObject<ImageViewer>(item);
|
// If our computation of image size doesn't fit the client's
|
||||||
v->setInfo(item->address ?
|
// chances are that we can't properly display it either.
|
||||||
tr("%1 Object at %2").arg(item->type, item->hexAddress()) :
|
if (size == nbytes) {
|
||||||
tr("%1 Object at Unknown Address").arg(item->type) + " " +
|
std::memcpy(im.bits(), bits, nbytes);
|
||||||
ImageViewer::tr("Size: %1x%2, %3 byte, format: %4, depth: %5")
|
auto v = m_separatedView->prepareObject<ImageViewer>(item);
|
||||||
.arg(width).arg(height).arg(nbytes).arg(im.format()).arg(im.depth())
|
v->setInfo(item->address ?
|
||||||
);
|
tr("%1 Object at %2").arg(item->type, item->hexAddress()) :
|
||||||
v->setImage(im);
|
tr("%1 Object at Unknown Address").arg(item->type) + " " +
|
||||||
|
ImageViewer::tr("Size: %1x%2, %3 byte, format: %4, depth: %5")
|
||||||
|
.arg(width).arg(height).arg(nbytes).arg(im.format()).arg(im.depth())
|
||||||
|
);
|
||||||
|
v->setImage(im);
|
||||||
|
}
|
||||||
} else if (format == DisplayLatin1String
|
} else if (format == DisplayLatin1String
|
||||||
|| format == DisplayUtf8String
|
|| format == DisplayUtf8String
|
||||||
|| format == DisplayUtf16String
|
|| format == DisplayUtf16String
|
||||||
|
@@ -103,26 +103,37 @@ void ResourceHandler::updateResourcesHelper(bool updateProjectResources)
|
|||||||
|
|
||||||
// Find the (sub-)project the file belongs to. We don't want to find resources
|
// Find the (sub-)project the file belongs to. We don't want to find resources
|
||||||
// from other parts of the project tree, e.g. via a qmake subdirs project.
|
// from other parts of the project tree, e.g. via a qmake subdirs project.
|
||||||
ProjectNode *projectNode = project->rootProjectNode();
|
Node * const fileNode = project->rootProjectNode()->findNode([&fileName](const Node *n) {
|
||||||
Node * const fileNode = projectNode->findNode([&fileName](const Node *n) {
|
|
||||||
return n->filePath().toString() == fileName;
|
return n->filePath().toString() == fileName;
|
||||||
});
|
});
|
||||||
|
ProjectNode *projectNodeForUiFile = nullptr;
|
||||||
if (fileNode) {
|
if (fileNode) {
|
||||||
// We do not want qbs groups or qmake .pri files here, as they contain only a subset
|
// We do not want qbs groups or qmake .pri files here, as they contain only a subset
|
||||||
// of the relevant files.
|
// of the relevant files.
|
||||||
projectNode = fileNode->parentProjectNode();
|
projectNodeForUiFile = fileNode->parentProjectNode();
|
||||||
while (projectNode && !projectNode->isProduct())
|
while (projectNodeForUiFile && !projectNodeForUiFile->isProduct())
|
||||||
projectNode = projectNode->parentProjectNode();
|
projectNodeForUiFile = projectNodeForUiFile->parentProjectNode();
|
||||||
}
|
}
|
||||||
if (!projectNode)
|
if (!projectNodeForUiFile)
|
||||||
projectNode = project->rootProjectNode();
|
projectNodeForUiFile = project->rootProjectNode();
|
||||||
|
|
||||||
|
const auto useQrcFile = [projectNodeForUiFile, project](const Node *qrcNode) {
|
||||||
|
if (projectNodeForUiFile == project->rootProjectNode())
|
||||||
|
return true;
|
||||||
|
ProjectNode *projectNodeForQrcFile = qrcNode->parentProjectNode();
|
||||||
|
while (projectNodeForQrcFile && !projectNodeForQrcFile->isProduct())
|
||||||
|
projectNodeForQrcFile = projectNodeForQrcFile->parentProjectNode();
|
||||||
|
return !projectNodeForQrcFile
|
||||||
|
|| projectNodeForQrcFile == projectNodeForUiFile
|
||||||
|
|| projectNodeForQrcFile->productType() != ProductType::App;
|
||||||
|
};
|
||||||
|
|
||||||
QStringList projectQrcFiles;
|
QStringList projectQrcFiles;
|
||||||
projectNode->forEachNode([&](FileNode *node) {
|
project->rootProjectNode()->forEachNode([&](FileNode *node) {
|
||||||
if (node->fileType() == FileType::Resource)
|
if (node->fileType() == FileType::Resource && useQrcFile(node))
|
||||||
projectQrcFiles.append(node->filePath().toString());
|
projectQrcFiles.append(node->filePath().toString());
|
||||||
}, [&](FolderNode *node) {
|
}, [&](FolderNode *node) {
|
||||||
if (dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node))
|
if (dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node) && useQrcFile(node))
|
||||||
projectQrcFiles.append(node->filePath().toString());
|
projectQrcFiles.append(node->filePath().toString());
|
||||||
});
|
});
|
||||||
// Check if the user has chosen to update the lacking resource inside designer
|
// Check if the user has chosen to update the lacking resource inside designer
|
||||||
@@ -134,7 +145,7 @@ void ResourceHandler::updateResourcesHelper(bool updateProjectResources)
|
|||||||
}
|
}
|
||||||
if (!qrcPathsToBeAdded.isEmpty()) {
|
if (!qrcPathsToBeAdded.isEmpty()) {
|
||||||
m_handlingResources = true;
|
m_handlingResources = true;
|
||||||
projectNode->addFiles(qrcPathsToBeAdded);
|
projectNodeForUiFile->addFiles(qrcPathsToBeAdded);
|
||||||
m_handlingResources = false;
|
m_handlingResources = false;
|
||||||
projectQrcFiles += qrcPathsToBeAdded;
|
projectQrcFiles += qrcPathsToBeAdded;
|
||||||
}
|
}
|
||||||
|
@@ -57,6 +57,8 @@ enum class FileType : quint16 {
|
|||||||
FileTypeSize
|
FileTypeSize
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class ProductType { App, Lib, Other, None };
|
||||||
|
|
||||||
enum ProjectAction {
|
enum ProjectAction {
|
||||||
// Special value to indicate that the actions are handled by the parent
|
// Special value to indicate that the actions are handled by the parent
|
||||||
InheritedFromParent,
|
InheritedFromParent,
|
||||||
@@ -379,7 +381,8 @@ public:
|
|||||||
virtual QVariant data(Core::Id role) const;
|
virtual QVariant data(Core::Id role) const;
|
||||||
virtual bool setData(Core::Id role, const QVariant &value) const;
|
virtual bool setData(Core::Id role, const QVariant &value) const;
|
||||||
|
|
||||||
bool isProduct() const { return m_isProduct; }
|
bool isProduct() const { return m_productType != ProductType::None; }
|
||||||
|
ProductType productType() const { return m_productType; }
|
||||||
|
|
||||||
// TODO: Currently used only for "Build for current run config" functionality, but we should
|
// TODO: Currently used only for "Build for current run config" functionality, but we should
|
||||||
// probably use it to centralize the node-specific "Build" functionality that
|
// probably use it to centralize the node-specific "Build" functionality that
|
||||||
@@ -391,13 +394,13 @@ public:
|
|||||||
void setFallbackData(Core::Id key, const QVariant &value);
|
void setFallbackData(Core::Id key, const QVariant &value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setIsProduct() { m_isProduct = true; }
|
void setProductType(ProductType type) { m_productType = type; }
|
||||||
|
|
||||||
QString m_target;
|
QString m_target;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isProduct = false;
|
|
||||||
QHash<Core::Id, QVariant> m_fallbackData; // Used in data(), unless overridden.
|
QHash<Core::Id, QVariant> m_fallbackData; // Used in data(), unless overridden.
|
||||||
|
ProductType m_productType = ProductType::None;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT ContainerNode : public FolderNode
|
class PROJECTEXPLORER_EXPORT ContainerNode : public FolderNode
|
||||||
|
@@ -328,7 +328,14 @@ QbsProductNode::QbsProductNode(const qbs::ProductData &prd) :
|
|||||||
{
|
{
|
||||||
static QIcon productIcon = Core::FileIconProvider::directoryIcon(Constants::QBS_PRODUCT_OVERLAY_ICON);
|
static QIcon productIcon = Core::FileIconProvider::directoryIcon(Constants::QBS_PRODUCT_OVERLAY_ICON);
|
||||||
setIcon(productIcon);
|
setIcon(productIcon);
|
||||||
setIsProduct();
|
if (m_qbsProductData.isRunnable()) {
|
||||||
|
setProductType(ProductType::App);
|
||||||
|
} else if (m_qbsProductData.type().contains("dynamiclibrary")
|
||||||
|
|| m_qbsProductData.type().contains("staticlibrary")) {
|
||||||
|
setProductType(ProductType::Lib);
|
||||||
|
} else {
|
||||||
|
setProductType(ProductType::Other);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QbsProductNode::supportsAction(ProjectAction action, const Node *node) const
|
bool QbsProductNode::supportsAction(ProjectAction action, const Node *node) const
|
||||||
|
@@ -257,7 +257,14 @@ FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringL
|
|||||||
QmakeProFileNode::QmakeProFileNode(QmakeProject *project, const FilePath &filePath, QmakeProFile *pf) :
|
QmakeProFileNode::QmakeProFileNode(QmakeProject *project, const FilePath &filePath, QmakeProFile *pf) :
|
||||||
QmakePriFileNode(project, this, filePath, pf)
|
QmakePriFileNode(project, this, filePath, pf)
|
||||||
{
|
{
|
||||||
setIsProduct();
|
if (projectType() == ProjectType::ApplicationTemplate) {
|
||||||
|
setProductType(ProductType::App);
|
||||||
|
} else if (projectType() == ProjectType::SharedLibraryTemplate
|
||||||
|
|| projectType() == ProjectType::StaticLibraryTemplate) {
|
||||||
|
setProductType(ProductType::Lib);
|
||||||
|
} else if (projectType() != ProjectType::SubDirsTemplate) {
|
||||||
|
setProductType(ProductType::Other);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmakeProFileNode::showInSimpleTree() const
|
bool QmakeProFileNode::showInSimpleTree() const
|
||||||
|
@@ -662,3 +662,12 @@ def addCPlusPlusFile(name, template, projectName, forceOverwrite=False, addToVCS
|
|||||||
buttonToClick = 'Cancel'
|
buttonToClick = 'Cancel'
|
||||||
clickButton("{text='%s' type='QPushButton' unnamed='1' visible='1' window=%s}"
|
clickButton("{text='%s' type='QPushButton' unnamed='1' visible='1' window=%s}"
|
||||||
% (buttonToClick, overwriteDialog))
|
% (buttonToClick, overwriteDialog))
|
||||||
|
|
||||||
|
# if one of the parameters is set to 0 or below the respective parsing won't be waited for
|
||||||
|
def waitForProjectParsing(projectParsingTimeout=10000, codemodelParsingTimeout=10000):
|
||||||
|
if projectParsingTimeout > 0:
|
||||||
|
runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton')
|
||||||
|
# Wait for parsing to complete
|
||||||
|
waitFor("runButton.enabled", projectParsingTimeout)
|
||||||
|
if codemodelParsingTimeout > 0:
|
||||||
|
progressBarWait(codemodelParsingTimeout)
|
||||||
|
@@ -44,7 +44,7 @@ def main():
|
|||||||
# open example project
|
# open example project
|
||||||
openQmakeProject(examplePath)
|
openQmakeProject(examplePath)
|
||||||
# wait for parsing to complete
|
# wait for parsing to complete
|
||||||
progressBarWait(30000)
|
waitForProjectParsing()
|
||||||
checkCodeModelSettings(useClang)
|
checkCodeModelSettings(useClang)
|
||||||
# open .cpp file in editor
|
# open .cpp file in editor
|
||||||
if not openDocument("openglwindow.Sources.main\\.cpp"):
|
if not openDocument("openglwindow.Sources.main\\.cpp"):
|
||||||
|
@@ -43,7 +43,7 @@ def main():
|
|||||||
# open example project
|
# open example project
|
||||||
openQmakeProject(examplePath)
|
openQmakeProject(examplePath)
|
||||||
# wait for parsing to complete
|
# wait for parsing to complete
|
||||||
progressBarWait(30000)
|
waitForProjectParsing()
|
||||||
checkCodeModelSettings(useClang)
|
checkCodeModelSettings(useClang)
|
||||||
# open .cpp file in editor
|
# open .cpp file in editor
|
||||||
if not openDocument("openglwindow.Sources.main\\.cpp"):
|
if not openDocument("openglwindow.Sources.main\\.cpp"):
|
||||||
|
@@ -99,7 +99,7 @@ def main():
|
|||||||
# select "Open project" and select a project
|
# select "Open project" and select a project
|
||||||
examplePath = os.path.join(prepareTemplate(sourceExample), "animation.pro")
|
examplePath = os.path.join(prepareTemplate(sourceExample), "animation.pro")
|
||||||
openQmakeProject(examplePath, fromWelcome = True)
|
openQmakeProject(examplePath, fromWelcome = True)
|
||||||
progressBarWait(30000)
|
waitForProjectParsing()
|
||||||
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
|
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
|
||||||
" text~='animation( \(.*\))?' type='QModelIndex'}"),
|
" text~='animation( \(.*\))?' type='QModelIndex'}"),
|
||||||
"Verifying: The project is opened in 'Edit' mode after configuring.")
|
"Verifying: The project is opened in 'Edit' mode after configuring.")
|
||||||
|
@@ -42,7 +42,7 @@ def main():
|
|||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
openQmakeProject(proFile)
|
openQmakeProject(proFile)
|
||||||
progressBarWait(20000)
|
waitForProjectParsing()
|
||||||
selectFromLocator("dummy.cpp")
|
selectFromLocator("dummy.cpp")
|
||||||
|
|
||||||
## Waiting for a solution from Froglogic to make the below work.
|
## Waiting for a solution from Froglogic to make the below work.
|
||||||
|
@@ -42,7 +42,7 @@ def main():
|
|||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
openQmakeProject(SpeedCrunchPath, [Targets.DESKTOP_4_8_7_DEFAULT])
|
openQmakeProject(SpeedCrunchPath, [Targets.DESKTOP_4_8_7_DEFAULT])
|
||||||
progressBarWait(30000)
|
waitForProjectParsing()
|
||||||
|
|
||||||
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@ def main():
|
|||||||
test.fatal("Could not open/create cmake project - leaving test")
|
test.fatal("Could not open/create cmake project - leaving test")
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
return
|
return
|
||||||
progressBarWait(30000)
|
waitForProjectParsing()
|
||||||
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
||||||
if cmakeSupportsServerMode():
|
if cmakeSupportsServerMode():
|
||||||
treeFile = "projecttree_speedcrunch_server.tsv"
|
treeFile = "projecttree_speedcrunch_server.tsv"
|
||||||
|
@@ -46,7 +46,7 @@ def main():
|
|||||||
"OTHER_FILES += example.qml")
|
"OTHER_FILES += example.qml")
|
||||||
invokeMenuItem("File", "Save All")
|
invokeMenuItem("File", "Save All")
|
||||||
invokeMenuItem("File", "Close All")
|
invokeMenuItem("File", "Close All")
|
||||||
progressBarWait()
|
waitForProjectParsing()
|
||||||
for filetype, filename in [["Headers", "person.h"],
|
for filetype, filename in [["Headers", "person.h"],
|
||||||
["Sources", "main.cpp"],
|
["Sources", "main.cpp"],
|
||||||
["Sources", "person.cpp"],
|
["Sources", "person.cpp"],
|
||||||
@@ -66,7 +66,7 @@ def main():
|
|||||||
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
|
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
|
||||||
previous, filename)
|
previous, filename)
|
||||||
# QTCREATORBUG-13176 does update the navigator async
|
# QTCREATORBUG-13176 does update the navigator async
|
||||||
progressBarWait()
|
waitForProjectParsing()
|
||||||
if filetype == "Headers":
|
if filetype == "Headers":
|
||||||
verifyRenamedIncludes(templateDir, "main.cpp", previous, filename)
|
verifyRenamedIncludes(templateDir, "main.cpp", previous, filename)
|
||||||
verifyRenamedIncludes(templateDir, "person.cpp", previous, filename)
|
verifyRenamedIncludes(templateDir, "person.cpp", previous, filename)
|
||||||
|
@@ -40,7 +40,7 @@ def main():
|
|||||||
checkWelcomePage(sessionName, True)
|
checkWelcomePage(sessionName, True)
|
||||||
for project in projects:
|
for project in projects:
|
||||||
openQmakeProject(project, [Targets.DESKTOP_5_6_1_DEFAULT])
|
openQmakeProject(project, [Targets.DESKTOP_5_6_1_DEFAULT])
|
||||||
progressBarWait(20000)
|
waitForProjectParsing()
|
||||||
checkNavigator(52, "Verifying whether all projects have been opened.")
|
checkNavigator(52, "Verifying whether all projects have been opened.")
|
||||||
openDocument("animation.Resources.animation\\.qrc./animation.basics.animators\\.qml")
|
openDocument("animation.Resources.animation\\.qrc./animation.basics.animators\\.qml")
|
||||||
openDocument("keyinteraction.Sources.main\\.cpp")
|
openDocument("keyinteraction.Sources.main\\.cpp")
|
||||||
|
@@ -33,7 +33,7 @@ def main():
|
|||||||
# using a temporary directory won't mess up a potentially existing
|
# using a temporary directory won't mess up a potentially existing
|
||||||
createNewQmlExtension(tempDir(), [target])
|
createNewQmlExtension(tempDir(), [target])
|
||||||
# wait for parsing to complete
|
# wait for parsing to complete
|
||||||
progressBarWait(30000)
|
waitForProjectParsing()
|
||||||
test.log("Building project Qt Quick 2 Extension Plugin (%s)"
|
test.log("Building project Qt Quick 2 Extension Plugin (%s)"
|
||||||
% Targets.getStringForTarget(target))
|
% Targets.getStringForTarget(target))
|
||||||
invokeMenuItem("Build","Build All")
|
invokeMenuItem("Build","Build All")
|
||||||
|
Reference in New Issue
Block a user