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()
|
||||
install(TARGETS OptionalSvg EXPORT QtCreator)
|
||||
|
||||
find_package(LLVM QUIET)
|
||||
find_package(Clang COMPONENTS libclang QUIET)
|
||||
find_package(LLVM QUIET)
|
||||
|
||||
if (APPLE)
|
||||
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
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
|
||||
|
@@ -174,7 +174,7 @@ CMakeTargetNode::CMakeTargetNode(const Utils::FilePath &directory, const QString
|
||||
setPriority(Node::DefaultProjectPriority + 900);
|
||||
setIcon(QIcon(":/projectexplorer/images/build.png")); // TODO: Use proper icon!
|
||||
setListInProject(false);
|
||||
setIsProduct();
|
||||
setProductType(ProductType::Other);
|
||||
}
|
||||
|
||||
QString CMakeTargetNode::tooltip() const
|
||||
|
@@ -117,7 +117,10 @@ OutputWindow::OutputWindow(Context context, const QString &settingsKey, QWidget
|
||||
connect(copyAction, &QAction::triggered, this, &QPlainTextEdit::copy);
|
||||
connect(pasteAction, &QAction::triggered, this, &QPlainTextEdit::paste);
|
||||
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::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 < imformat && imformat < 32, return);
|
||||
QImage im(width, height, QImage::Format(imformat));
|
||||
std::memcpy(im.bits(), bits, nbytes);
|
||||
auto v = m_separatedView->prepareObject<ImageViewer>(item);
|
||||
v->setInfo(item->address ?
|
||||
tr("%1 Object at %2").arg(item->type, item->hexAddress()) :
|
||||
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);
|
||||
const qsizetype size = im.sizeInBytes();
|
||||
// If our computation of image size doesn't fit the client's
|
||||
// chances are that we can't properly display it either.
|
||||
if (size == nbytes) {
|
||||
std::memcpy(im.bits(), bits, nbytes);
|
||||
auto v = m_separatedView->prepareObject<ImageViewer>(item);
|
||||
v->setInfo(item->address ?
|
||||
tr("%1 Object at %2").arg(item->type, item->hexAddress()) :
|
||||
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
|
||||
|| format == DisplayUtf8String
|
||||
|| 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
|
||||
// from other parts of the project tree, e.g. via a qmake subdirs project.
|
||||
ProjectNode *projectNode = project->rootProjectNode();
|
||||
Node * const fileNode = projectNode->findNode([&fileName](const Node *n) {
|
||||
Node * const fileNode = project->rootProjectNode()->findNode([&fileName](const Node *n) {
|
||||
return n->filePath().toString() == fileName;
|
||||
});
|
||||
ProjectNode *projectNodeForUiFile = nullptr;
|
||||
if (fileNode) {
|
||||
// We do not want qbs groups or qmake .pri files here, as they contain only a subset
|
||||
// of the relevant files.
|
||||
projectNode = fileNode->parentProjectNode();
|
||||
while (projectNode && !projectNode->isProduct())
|
||||
projectNode = projectNode->parentProjectNode();
|
||||
projectNodeForUiFile = fileNode->parentProjectNode();
|
||||
while (projectNodeForUiFile && !projectNodeForUiFile->isProduct())
|
||||
projectNodeForUiFile = projectNodeForUiFile->parentProjectNode();
|
||||
}
|
||||
if (!projectNode)
|
||||
projectNode = project->rootProjectNode();
|
||||
if (!projectNodeForUiFile)
|
||||
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;
|
||||
projectNode->forEachNode([&](FileNode *node) {
|
||||
if (node->fileType() == FileType::Resource)
|
||||
project->rootProjectNode()->forEachNode([&](FileNode *node) {
|
||||
if (node->fileType() == FileType::Resource && useQrcFile(node))
|
||||
projectQrcFiles.append(node->filePath().toString());
|
||||
}, [&](FolderNode *node) {
|
||||
if (dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node))
|
||||
if (dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node) && useQrcFile(node))
|
||||
projectQrcFiles.append(node->filePath().toString());
|
||||
});
|
||||
// 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()) {
|
||||
m_handlingResources = true;
|
||||
projectNode->addFiles(qrcPathsToBeAdded);
|
||||
projectNodeForUiFile->addFiles(qrcPathsToBeAdded);
|
||||
m_handlingResources = false;
|
||||
projectQrcFiles += qrcPathsToBeAdded;
|
||||
}
|
||||
|
@@ -57,6 +57,8 @@ enum class FileType : quint16 {
|
||||
FileTypeSize
|
||||
};
|
||||
|
||||
enum class ProductType { App, Lib, Other, None };
|
||||
|
||||
enum ProjectAction {
|
||||
// Special value to indicate that the actions are handled by the parent
|
||||
InheritedFromParent,
|
||||
@@ -379,7 +381,8 @@ public:
|
||||
virtual QVariant data(Core::Id role) 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
|
||||
// probably use it to centralize the node-specific "Build" functionality that
|
||||
@@ -391,13 +394,13 @@ public:
|
||||
void setFallbackData(Core::Id key, const QVariant &value);
|
||||
|
||||
protected:
|
||||
void setIsProduct() { m_isProduct = true; }
|
||||
void setProductType(ProductType type) { m_productType = type; }
|
||||
|
||||
QString m_target;
|
||||
|
||||
private:
|
||||
bool m_isProduct = false;
|
||||
QHash<Core::Id, QVariant> m_fallbackData; // Used in data(), unless overridden.
|
||||
ProductType m_productType = ProductType::None;
|
||||
};
|
||||
|
||||
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);
|
||||
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
|
||||
|
@@ -257,7 +257,14 @@ FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringL
|
||||
QmakeProFileNode::QmakeProFileNode(QmakeProject *project, const FilePath &filePath, QmakeProFile *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
|
||||
|
@@ -662,3 +662,12 @@ def addCPlusPlusFile(name, template, projectName, forceOverwrite=False, addToVCS
|
||||
buttonToClick = 'Cancel'
|
||||
clickButton("{text='%s' type='QPushButton' unnamed='1' visible='1' window=%s}"
|
||||
% (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
|
||||
openQmakeProject(examplePath)
|
||||
# wait for parsing to complete
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
checkCodeModelSettings(useClang)
|
||||
# open .cpp file in editor
|
||||
if not openDocument("openglwindow.Sources.main\\.cpp"):
|
||||
|
@@ -43,7 +43,7 @@ def main():
|
||||
# open example project
|
||||
openQmakeProject(examplePath)
|
||||
# wait for parsing to complete
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
checkCodeModelSettings(useClang)
|
||||
# open .cpp file in editor
|
||||
if not openDocument("openglwindow.Sources.main\\.cpp"):
|
||||
|
@@ -99,7 +99,7 @@ def main():
|
||||
# select "Open project" and select a project
|
||||
examplePath = os.path.join(prepareTemplate(sourceExample), "animation.pro")
|
||||
openQmakeProject(examplePath, fromWelcome = True)
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
|
||||
" text~='animation( \(.*\))?' type='QModelIndex'}"),
|
||||
"Verifying: The project is opened in 'Edit' mode after configuring.")
|
||||
|
@@ -42,7 +42,7 @@ def main():
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(proFile)
|
||||
progressBarWait(20000)
|
||||
waitForProjectParsing()
|
||||
selectFromLocator("dummy.cpp")
|
||||
|
||||
## Waiting for a solution from Froglogic to make the below work.
|
||||
|
@@ -42,7 +42,7 @@ def main():
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(SpeedCrunchPath, [Targets.DESKTOP_4_8_7_DEFAULT])
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
|
||||
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
||||
|
||||
|
@@ -60,7 +60,7 @@ def main():
|
||||
test.fatal("Could not open/create cmake project - leaving test")
|
||||
invokeMenuItem("File", "Exit")
|
||||
return
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
||||
if cmakeSupportsServerMode():
|
||||
treeFile = "projecttree_speedcrunch_server.tsv"
|
||||
|
@@ -46,7 +46,7 @@ def main():
|
||||
"OTHER_FILES += example.qml")
|
||||
invokeMenuItem("File", "Save All")
|
||||
invokeMenuItem("File", "Close All")
|
||||
progressBarWait()
|
||||
waitForProjectParsing()
|
||||
for filetype, filename in [["Headers", "person.h"],
|
||||
["Sources", "main.cpp"],
|
||||
["Sources", "person.cpp"],
|
||||
@@ -66,7 +66,7 @@ def main():
|
||||
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
|
||||
previous, filename)
|
||||
# QTCREATORBUG-13176 does update the navigator async
|
||||
progressBarWait()
|
||||
waitForProjectParsing()
|
||||
if filetype == "Headers":
|
||||
verifyRenamedIncludes(templateDir, "main.cpp", previous, filename)
|
||||
verifyRenamedIncludes(templateDir, "person.cpp", previous, filename)
|
||||
|
@@ -40,7 +40,7 @@ def main():
|
||||
checkWelcomePage(sessionName, True)
|
||||
for project in projects:
|
||||
openQmakeProject(project, [Targets.DESKTOP_5_6_1_DEFAULT])
|
||||
progressBarWait(20000)
|
||||
waitForProjectParsing()
|
||||
checkNavigator(52, "Verifying whether all projects have been opened.")
|
||||
openDocument("animation.Resources.animation\\.qrc./animation.basics.animators\\.qml")
|
||||
openDocument("keyinteraction.Sources.main\\.cpp")
|
||||
|
@@ -33,7 +33,7 @@ def main():
|
||||
# using a temporary directory won't mess up a potentially existing
|
||||
createNewQmlExtension(tempDir(), [target])
|
||||
# wait for parsing to complete
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
test.log("Building project Qt Quick 2 Extension Plugin (%s)"
|
||||
% Targets.getStringForTarget(target))
|
||||
invokeMenuItem("Build","Build All")
|
||||
|
Reference in New Issue
Block a user