Commit 48db93a9 authored by con's avatar con
Browse files

Merge remote branch 'origin/2.0'

parents 3b113a2d 6383643d
......@@ -166,15 +166,14 @@ bool Ne7sshSftp::receiveUntil (short _cmd, uint32 timeSec)
SecureVector<Botan::byte> packet;
uint32 cutoff = timeSec * 1000000, timeout = 0;
uint32 prevSize = 0;
bool status;
this->sftpCmd = 0;
commBuffer.clear();
while (true)
{
status = _transport->waitForPacket (0, false);
if (status)
const short status = _transport->waitForPacket (0, false);
if (status > 0)
{
_transport->getPacket (packet);
if (!handleReceived (packet)) return false;
......
......@@ -77,7 +77,8 @@ void Link::initializeScopeChain()
// ### TODO: Which type environment do scripts see?
scopeChain.jsScopes += bind->rootObjectValue();
if (bind->rootObjectValue())
scopeChain.jsScopes += bind->rootObjectValue();
}
scopeChain.update();
......@@ -142,7 +143,7 @@ void Link::populateImportedTypes(Interpreter::ObjectValue *typeEnv, Document::Pt
// implicit imports:
// qml files in the same directory are available without explicit imports
foreach (Document::Ptr otherDoc, _snapshot.documentsInDirectory(doc->path())) {
if (otherDoc == doc)
if (otherDoc == doc || !otherDoc->bind()->rootObjectValue())
continue;
typeEnv->setProperty(otherDoc->componentName(),
......@@ -194,20 +195,24 @@ void Link::importFile(Interpreter::ObjectValue *typeEnv, Document::Ptr doc,
}
foreach (Document::Ptr importedDoc, documentsInDirectory) {
const QString targetName = importedDoc->componentName();
importNamespace->setProperty(targetName, importedDoc->bind()->rootObjectValue());
if (importedDoc->bind()->rootObjectValue()) {
const QString targetName = importedDoc->componentName();
importNamespace->setProperty(targetName, importedDoc->bind()->rootObjectValue());
}
}
}
// file import
else if (Document::Ptr importedDoc = _snapshot.document(path)) {
QString targetName;
if (import->importId) {
targetName = import->importId->asString();
} else {
targetName = importedDoc->componentName();
}
if (importedDoc->bind()->rootObjectValue()) {
QString targetName;
if (import->importId) {
targetName = import->importId->asString();
} else {
targetName = importedDoc->componentName();
}
importNamespace->setProperty(targetName, importedDoc->bind()->rootObjectValue());
importNamespace->setProperty(targetName, importedDoc->bind()->rootObjectValue());
}
} else {
error(doc, import->fileNameToken,
tr("could not find file or directory"));
......@@ -297,7 +302,8 @@ void Link::importNonFile(Interpreter::ObjectValue *typeEnv, Document::Ptr doc, A
importedTypes.insert(component.typeName);
if (Document::Ptr importedDoc = _snapshot.document(dir.filePath(component.fileName))) {
namespaceObject->setProperty(component.typeName, importedDoc->bind()->rootObjectValue());
if (importedDoc->bind()->rootObjectValue())
namespaceObject->setProperty(component.typeName, importedDoc->bind()->rootObjectValue());
}
}
......
......@@ -980,7 +980,8 @@ static inline QString msgExecutionLogEntry(const QString &workingDir, const QStr
const QString args = arguments.join(QString(QLatin1Char(' ')));
if (workingDir.isEmpty())
return CVSPlugin::tr("Executing: %1 %2\n").arg(executable, args);
return CVSPlugin::tr("Executing in %1: %2 %3\n").arg(workingDir, executable, args);
return CVSPlugin::tr("Executing in %1: %2 %3\n").
arg(QDir::toNativeSeparators(workingDir), executable, args);
}
// Run CVS. At this point, file arguments must be relative to
......
......@@ -155,8 +155,9 @@ static inline QString clientRootFromOutput(const QString &in)
QRegExp regExp(QLatin1String("(\\n|\\r\\n|\\r)Root:\\s*(.*)(\\n|\\r\\n|\\r)"));
QTC_ASSERT(regExp.isValid(), return QString());
regExp.setMinimal(true);
// Normalize slashes and capitalization of Windows drive letters for caching.
if (regExp.indexIn(in) != -1)
return regExp.cap(2).trimmed();
return QFileInfo(regExp.cap(2).trimmed()).absoluteFilePath();
return QString();
}
......
......@@ -825,8 +825,8 @@ QVariantMap Version1Handler::update(Project *project, const QVariantMap &map)
else if (project->id() == QLatin1String("QmlProjectManager.QmlProject"))
targets << TargetDescription(QString::fromLatin1("QmlProjectManager.QmlTarget"),
QCoreApplication::translate("QmlProjectManager::QmlTarget",
"QML Runtime",
"QML Runtime target display name"));
"QML Viewer",
"QML Viewer target display name"));
else
return QVariantMap(); // We do not know how to handle this.
......
......@@ -101,7 +101,7 @@ void QmlProject::parseProject(RefreshOptions options)
} else {
Core::MessageManager *messageManager = Core::ICore::instance()->messageManager();
messageManager->printToOutputPane(tr("Error while loading project file!"));
messageManager->printToOutputPane(component->errorsString(), true);
messageManager->printToOutputPane(component->errorString(), true);
}
}
}
......
......@@ -33,11 +33,11 @@ namespace QmlProjectManager {
namespace Constants {
const char * const QML_RC_ID("QmlProjectManager.QmlRunConfiguration");
const char * const QML_RC_DISPLAY_NAME(QT_TRANSLATE_NOOP("QmlProjectManager::Internal::QmlRunConfiguration", "QML Runtime"));
const char * const QML_RC_DISPLAY_NAME(QT_TRANSLATE_NOOP("QmlProjectManager::Internal::QmlRunConfiguration", "QML Viewer"));
const char * const QML_VIEWER_KEY("QmlProjectManager.QmlRunConfiguration.QDeclarativeViewer");
const char * const QML_VIEWER_ARGUMENTS_KEY("QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments");
const char * const QML_VIEWER_TARGET_ID("QmlProjectManager.QmlTarget");
const char * const QML_VIEWER_TARGET_DISPLAY_NAME("QML Runtime");
const char * const QML_VIEWER_TARGET_DISPLAY_NAME("QML Viewer");
const char * const QML_MAINSCRIPT_KEY("QmlProjectManager.QmlRunConfiguration.MainScript");
const char * const QML_DEBUG_SERVER_ADDRESS_KEY("QmlProjectManager.QmlRunConfiguration.DebugServerAddress");
const char * const QML_DEBUG_SERVER_PORT_KEY("QmlProjectManager.QmlRunConfiguration.DebugServerPort");
......
......@@ -99,13 +99,20 @@ void QmlProjectRunConfiguration::ctor()
connect(em, SIGNAL(currentEditorChanged(Core::IEditor*)),
this, SLOT(changeCurrentFile(Core::IEditor*)));
setDisplayName(tr("QML Runtime", "QMLRunConfiguration display name."));
setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name."));
// prepend creator/bin dir to search path (only useful for special creator-qml package)
const QString searchPath = QCoreApplication::applicationDirPath()
+ Utils::SynchronousProcess::pathSeparator()
+ QString(qgetenv("PATH"));
m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, QLatin1String("qml"));
#ifdef Q_OS_MAC
const QString qmlViewerName = QLatin1String("QMLViewer");
#else
const QString qmlViewerName = QLatin1String("qmlviewer");
#endif
m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, qmlViewerName);
}
QmlProjectRunConfiguration::~QmlProjectRunConfiguration()
......@@ -196,8 +203,8 @@ QWidget *QmlProjectRunConfiguration::createConfigurationWidget()
debugPort->setValue(m_debugData.serverPort);
connect(debugPort, SIGNAL(valueChanged(int)), this, SLOT(onDebugServerPortChanged()));
form->addRow(tr("QML Runtime"), qmlViewer);
form->addRow(tr("QML Runtime arguments:"), qmlViewerArgs);
form->addRow(tr("QML Viewer"), qmlViewer);
form->addRow(tr("QML Viewer arguments:"), qmlViewerArgs);
form->addRow(tr("Main QML File:"), m_fileListCombo.data());
form->addRow(tr("Debugging Address:"), debugServer);
form->addRow(tr("Debugging Port:"), debugPort);
......
......@@ -45,7 +45,7 @@ QmlProjectTarget::QmlProjectTarget(QmlProject *parent) :
{
setDisplayName(QApplication::translate("QmlProjectManager::QmlTarget",
Constants::QML_VIEWER_TARGET_DISPLAY_NAME,
"QML Runtime target display name"));
"QML Viewer target display name"));
setIcon(qApp->style()->standardIcon(QStyle::SP_ComputerIcon));
}
......@@ -75,7 +75,7 @@ bool QmlProjectTarget::fromMap(const QVariantMap &map)
setDisplayName(QApplication::translate("QmlProjectManager::QmlTarget",
Constants::QML_VIEWER_TARGET_DISPLAY_NAME,
"QML Runtime target display name"));
"QML Viewer target display name"));
return true;
}
......@@ -101,7 +101,7 @@ QString QmlProjectTargetFactory::displayNameForId(const QString &id) const
if (id == QLatin1String(Constants::QML_VIEWER_TARGET_ID))
return QCoreApplication::translate("QmlProjectManager::QmlTarget",
Constants::QML_VIEWER_TARGET_DISPLAY_NAME,
"QML Runtime target display name");
"QML Viewer target display name");
return QString();
}
......
......@@ -403,7 +403,7 @@ static QString detect_SDK_installedQt(const QString &epocRoot)
const QString coreLibDllFileName = epocRoot + QLatin1String("/epoc32/release/winscw/udeb/QtCore.dll");
QFile coreLibDllFile(coreLibDllFileName);
if (!coreLibDllFile.exists() || !coreLibDllFile.open(QIODevice::ReadOnly))
return false;
return QString();
// Do not normalize these backslashes since they are in ARM binaries:
const QByteArray indicator("\\src\\corelib\\kernel\\qobject.h");
......
......@@ -1030,7 +1030,8 @@ static inline QString msgExecutionLogEntry(const QString &workingDir, const QStr
const QString argsS = SubversionSettings::formatArguments(arguments);
if (workingDir.isEmpty())
return SubversionPlugin::tr("Executing: %1 %2\n").arg(executable, argsS);
return SubversionPlugin::tr("Executing in %1: %2 %3\n").arg(workingDir, executable, argsS);
return SubversionPlugin::tr("Executing in %1: %2 %3\n").
arg(QDir::toNativeSeparators(workingDir), executable, argsS);
}
SubversionResponse SubversionPlugin::runSvn(const QString &workingDir,
......@@ -1262,7 +1263,7 @@ QString SubversionPlugin::findTopLevelForDirectoryI(const QString &directory) co
return QString();
for (QDir parentDir = lastDirectory; parentDir.cdUp() ; lastDirectory = parentDir) {
if (!managesDirectory(parentDir))
return QDir::toNativeSeparators(lastDirectory.absolutePath());
return lastDirectory.absolutePath();
}
return QString();
}
......
......@@ -736,6 +736,8 @@ void TestCore::testRewriterForGradientMagic()
" }\n"
"}");
QSKIP("See BAUHAUS-674", SkipAll);
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
NotIndentingTextEditModifier modifier(&textEdit);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment