Merge remote branch 'origin/2.0'

Conflicts:
	doc/qtcreator.qdoc
	src/plugins/help/helpplugin.cpp
	src/plugins/projectexplorer/projectexplorer.cpp
	src/plugins/projectexplorer/projectexplorer.h
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.h
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationwidget.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp
	src/tools/qml/qmldump/main.cpp
This commit is contained in:
con
2010-06-24 11:40:22 +02:00
44 changed files with 11439 additions and 4539 deletions

64
README
View File

@@ -57,6 +57,70 @@ Qt Creator includes the following third-party components,
we thank the authors who made this possible: we thank the authors who made this possible:
* Open Source front-end for C++ (license MIT), enhanced for use in Qt Creator * Open Source front-end for C++ (license MIT), enhanced for use in Qt Creator
Roberto Raggi <roberto.raggi@gmail.com> Roberto Raggi <roberto.raggi@gmail.com>
QtCreator/src/shared/cplusplus QtCreator/src/shared/cplusplus
* Botan, a C++ crypto library. Version 1.8.8
Copyright (C) 1999-2004 The Botan Project. All rights reserved.
Copyright (C) 1999-2009 Jack Lloyd
2001 Peter J Jones
2004-2007 Justin Karneges
2005 Matthew Gregan
2005-2006 Matt Johnston
2006 Luca Piccarreta
2007 Yves Jerschow
2007-2008 FlexSecure GmbH
2007-2008 Technische Universitat Darmstadt
2007-2008 Falko Strenzke
2007-2008 Martin Doering
2007 Manuel Hartl
2007 Christoph Ludwig
2007 Patrick Sona
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions, and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The source code of Botan C++ crypto library can be found in
QtCreator/src/libs/3rdparty
* NetSieben SSH Library is a Secure Shell client library for C++. Version 1.3.2
Commercial License: For organizations who do not want to release the source
code for their applications as open source/ free software; in other words
they do not want to comply with the GNU General Public License (GPL) or Q
Public License.
Non Commercial / Open Source License: NetSieben believes in contributing back
to the open source community, thus it has released the SSH Library under Q
Public License as it is defined by Trolltech AS of Norway. The Open Source
License allows the user to use software under an open source / free software
license, and distribute it freely. The software can be used at no charge with
the condition that if the user uses the SSH Library in an application they
wish to redistribute, then the complete source code for your application must
be available and freely redistributable under reasonable conditions. For more
information on the used QPL License see:
QtCreator/src/libs/3rdparty/net7ssh/LICENSE.QPL
The source code of NetSieben Secure Shell C++ Library can be found in
QtCreator/src/libs/3rdparty.

View File

@@ -1,14 +0,0 @@
include(../qtcreator.pri)
TEMPLATE = app
TARGET = $$IDE_APP_WRAPPER
OBJECTS_DIR =
PRE_TARGETDEPS = $$PWD/qtcreator
QMAKE_LINK = cp $$PWD/qtcreator $@ && : IGNORE REST
QMAKE_CLEAN = $$IDE_APP_WRAPPER
target.path = /bin
INSTALLS += target

View File

@@ -1,36 +0,0 @@
#!/bin/sh
makeAbsolute() {
case "$1" in
/*)
# already absolute, return it
echo "$1"
;;
*)
# relative, prepend $2 made absolute
echo `makeAbsolute "$2" "$PWD"`/"$1" | sed 's,/\.$,,'
;;
esac
}
if test -L "$0"; then
# Try readlink(1)
readlink=`type readlink 2>/dev/null` || readlink=
if test -n "$readlink"; then
# We have readlink(1), so we can use it
me=`readlink -nf "$0"`
else
# No readlink(1), so let's try ls -l
me=`ls -l "$0" | sed 's/^.*-> //'`
base=`dirname "$0"`
me=`makeAbsolute "$me" "$base"`
fi
else
me="$0"
fi
bindir=`dirname "$me"`
libdir=`cd "${bindir}/../lib" ; pwd`
LD_LIBRARY_PATH="${libdir}:${libdir}/qtcreator:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
exec "${bindir}/qtcreator.bin" ${1+"$@"}

View File

@@ -10,7 +10,8 @@ defines = Q_QDOC \
Q_BYTE_ORDER \ Q_BYTE_ORDER \
QT_DEPRECATED \ QT_DEPRECATED \
Q_NO_USING_KEYWORD \ Q_NO_USING_KEYWORD \
__cplusplus __cplusplus \
qtquick
versionsym = QT_VERSION_STR versionsym = QT_VERSION_STR
@@ -38,6 +39,7 @@ extraimages.HTML = qt-logo \
feedbackground.png \ feedbackground.png \
horBar.png \ horBar.png \
page_bg.png \ page_bg.png \
page.png \
sprites-combined.png \ sprites-combined.png \
qtcreator-screenshots.png qtcreator-screenshots.png

View File

@@ -18,8 +18,12 @@
and developers to create applications for multiple desktop and mobile device and developers to create applications for multiple desktop and mobile device
platforms. platforms.
For application designers, Qt Creator provides two integrated For application designers, Qt Creator provides integrated
visual editors, \QD and \QMLD, that you can use to design and develop visual editors, \QD
\if defined(qtquick)
and \QMLD,
\endif
that you can use to design and develop
application user interfaces. application user interfaces.
For application developers, For application developers,
@@ -4990,7 +4994,7 @@
is a list of two integers, the first one specifies the actual number is a list of two integers, the first one specifies the actual number
of children and the second the maximum number of children to print. of children and the second the maximum number of children to print.
Similarly, using the \SubItem class helps to protect individual items. Similarly, using the \c SubItem class helps to protect individual items.
Example: Example:
\code \code
@@ -7267,7 +7271,7 @@
report them as bugs. report them as bugs.
For a list of fixed issues and added features, see the changelog file in For a list of fixed issues and added features, see the changelog file in
the qtcreator\dist folder or the \l{http://bugreports.qt.nokia.com}{Qt Bug Tracker}. the \c{qtcreator\dist} folder or the \l{http://bugreports.qt.nokia.com}{Qt Bug Tracker}.
\section1 General \section1 General

View File

@@ -53,6 +53,7 @@ qhp.QtCreator.extraFiles = \
images/feedbackground.png \ images/feedbackground.png \
images/horBar.png \ images/horBar.png \
images/page_bg.png \ images/page_bg.png \
images/page.png \
images/qt-logo.png \ images/qt-logo.png \
images/sprites-combined.png images/sprites-combined.png

BIN
doc/templates/images/sprites-combined.png vendored Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -456,7 +456,7 @@
.wrap .content .wrap .content
{ {
padding: 30px; padding: 30px;
word-wrap:break-word; word-wrap: break-word;
} }
.wrap .content li .wrap .content li
@@ -472,11 +472,32 @@
/* text-decoration: underline;*/ /* text-decoration: underline;*/
} }
.offline .wrap .content .wrap .content ol li {
{ background:none;
font: inherit;
margin-bottom:10px;
padding-left: 0px
}
.wrap .content ol li {
list-style-type:decimal;
}
.wrap .content .descr ol li {
margin-left: 45px;
}
.wrap .content {
padding-top: 15px; padding-top: 15px;
} }
.wrap .content ol img {
vertical-align: middle;
}
.wrap .content ul img {
vertical-align: middle;
}
.wrap .content h1 .wrap .content h1
{ {
font: 600 18px/1.2 Arial; font: 600 18px/1.2 Arial;
@@ -676,9 +697,9 @@
.shortCut-topleft-inactive .shortCut-topleft-inactive
{ {
padding-left: 3px; padding-left: 3px;
padding-right: 3px;
background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px; background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px;
height: 20px; height: 20px;
width: 110px;
} }
.shortCut-topleft-inactive span .shortCut-topleft-inactive span
{ {
@@ -698,7 +719,6 @@
{ {
list-style-type: none; list-style-type: none;
float: left; float: left;
width: 347px;
margin-left: 100px; margin-left: 100px;
} }
#shortCut li #shortCut li

View File

@@ -68,8 +68,7 @@ macx {
contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1 contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
IDE_APP_TARGET = qtcreator IDE_APP_TARGET = qtcreator
} else { } else {
IDE_APP_WRAPPER = qtcreator IDE_APP_TARGET = qtcreator
IDE_APP_TARGET = qtcreator.bin
} }
IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH/plugins IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH/plugins

View File

@@ -11,4 +11,3 @@ TEMPLATE = subdirs
CONFIG += ordered CONFIG += ordered
SUBDIRS = src share SUBDIRS = src share
unix:!macx:!isEmpty(copydata):SUBDIRS += bin

View File

@@ -0,0 +1,30 @@
#!/bin/bash
## Command line parameters
if [[ $# != 1 ]]; then
cat <<USAGE
usage:
$0 <branch>
Creates tar and zip source package from origin/<branch> and documentation-zip from current checkout.
Files and directories are named after <branch>.
example:
$0 2.0.0
USAGE
exit 1
fi
VERSION=$1
cd `dirname $0`/..
echo "Creating tar archive..."
git archive --format=tar --prefix=qt-creator-${VERSION}-src/ origin/${VERSION} | gzip > qt-creator-${VERSION}-src.tar.gz || exit 1
echo "Creating zip archive..."
git archive --format=zip --prefix=qt-creator-${VERSION}-src/ origin/${VERSION} > qt-creator-${VERSION}-src.zip || exit 1
echo "Creating documentation..."
rm -r doc/html
qmake -r && make docs_online || exit 1
cd doc
cp -r html qt-creator-${VERSION}
zip -r ../qt-creator-${VERSION}-doc.zip qt-creator-${VERSION}
rm -r qt-creator-${VERSION}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
include(../../../qtcreator.pri) include(../../../qtcreator.pri)
LANGUAGES = de pl ru LANGUAGES = de ja pl ru
#LANGUAGES = cs es fr hu it ja sl #LANGUAGES = cs es fr hu it sl
# var, prepend, append # var, prepend, append
defineReplace(prependAll) { defineReplace(prependAll) {

View File

@@ -187,17 +187,6 @@ int main(int argc, char **argv)
// Must be done before any QSettings class is created // Must be done before any QSettings class is created
QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope,
QCoreApplication::applicationDirPath()+QLatin1String(SHARE_PATH)); QCoreApplication::applicationDirPath()+QLatin1String(SHARE_PATH));
// Work around bug in QSettings which gets triggered on Windows & Mac only
#ifdef Q_OS_MAC
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope,
QDir::homePath()+"/.config");
#endif
#ifdef Q_OS_WIN
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope,
qgetenv("appdata"));
#endif
// keep this in sync with the MainWindow ctor in coreplugin/mainwindow.cpp // keep this in sync with the MainWindow ctor in coreplugin/mainwindow.cpp
const QSettings settings(QSettings::IniFormat, QSettings::UserScope, const QSettings settings(QSettings::IniFormat, QSettings::UserScope,
QLatin1String("Nokia"), QLatin1String("QtCreator")); QLatin1String("Nokia"), QLatin1String("QtCreator"));

View File

@@ -206,7 +206,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
QString(), QString(),
&ok); &ok);
if (!ok || buildConfigurationName.isEmpty()) if (!ok || buildConfigurationName.isEmpty())
return false; return 0;
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(cmtarget); CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(cmtarget);
bc->setDisplayName(buildConfigurationName); bc->setDisplayName(buildConfigurationName);
@@ -224,7 +224,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
bc->environment()); bc->environment());
if (copw.exec() != QDialog::Accepted) { if (copw.exec() != QDialog::Accepted) {
delete bc; delete bc;
return false; return 0;
} }
cmtarget->addBuildConfiguration(bc); // this also makes the name unique cmtarget->addBuildConfiguration(bc); // this also makes the name unique

View File

@@ -141,7 +141,7 @@ QString CMakeManager::qtVersionForQMake(const QString &qmakePath)
QProcess qmake; QProcess qmake;
qmake.start(qmakePath, QStringList(QLatin1String("--version"))); qmake.start(qmakePath, QStringList(QLatin1String("--version")));
if (!qmake.waitForFinished()) if (!qmake.waitForFinished())
return false; return QString();
QString output = qmake.readAllStandardOutput(); QString output = qmake.readAllStandardOutput();
QRegExp regexp(QLatin1String("(QMake version|Qmake version:)[\\s]*([\\d.]*)")); QRegExp regexp(QLatin1String("(QMake version|Qmake version:)[\\s]*([\\d.]*)"));
regexp.indexIn(output); regexp.indexIn(output);

View File

@@ -385,14 +385,13 @@ void HelpPlugin::setupUi()
connect(searchWidget, SIGNAL(linkActivated(QUrl)), m_centralWidget, connect(searchWidget, SIGNAL(linkActivated(QUrl)), m_centralWidget,
SLOT(setSourceFromSearch(QUrl))); SLOT(setSourceFromSearch(QUrl)));
// TODO: enable and find a proper keysequence as this is ambiguous shortcut = new QShortcut(m_splitter);
// shortcut = new QShortcut(m_splitter); shortcut->setWhatsThis(tr("Activate Search in Help mode"));
// shortcut->setWhatsThis(tr("Activate Search in Help mode")); cmd = am->registerShortcut(shortcut, QLatin1String("Help.SearchShortcut"),
// cmd = am->registerShortcut(shortcut, QLatin1String("Help.SearchShortcut"), modecontext);
// modecontext); cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Slash));
// cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::Key_S)); connect(shortcut, SIGNAL(activated()), this, SLOT(activateSearch()));
// connect(shortcut, SIGNAL(activated()), this, SLOT(activateSearch())); shortcutMap.insert(QLatin1String(SB_SEARCH), cmd);
// shortcutMap.insert(QLatin1String(SB_SEARCH), cmd);
BookmarkManager *manager = &LocalHelpManager::bookmarkManager(); BookmarkManager *manager = &LocalHelpManager::bookmarkManager();
BookmarkWidget *bookmarkWidget = new BookmarkWidget(manager, 0, false); BookmarkWidget *bookmarkWidget = new BookmarkWidget(manager, 0, false);
@@ -401,14 +400,13 @@ void HelpPlugin::setupUi()
connect(bookmarkWidget, SIGNAL(linkActivated(QUrl)), m_centralWidget, connect(bookmarkWidget, SIGNAL(linkActivated(QUrl)), m_centralWidget,
SLOT(setSource(QUrl))); SLOT(setSource(QUrl)));
// TODO: enable and find a proper keysequence as this is ambiguous shortcut = new QShortcut(m_splitter);
// shortcut = new QShortcut(m_splitter); shortcut->setWhatsThis(tr("Activate Bookmarks in Help mode"));
// shortcut->setWhatsThis(tr("Activate Bookmarks in Help mode")); cmd = am->registerShortcut(shortcut, QLatin1String("Help.BookmarkShortcut"),
// cmd = am->registerShortcut(shortcut, QLatin1String("Help.BookmarkShortcut"), modecontext);
// modecontext); cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B));
// cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::Key_B)); connect(shortcut, SIGNAL(activated()), this, SLOT(activateBookmarks()));
// connect(shortcut, SIGNAL(activated()), this, SLOT(activateBookmarks())); shortcutMap.insert(QLatin1String(SB_BOOKMARKS), cmd);
// shortcutMap.insert(QLatin1String(SB_BOOKMARKS), cmd);
QWidget *openPagesWidget = OpenPagesManager::instance().openPagesWidget(); QWidget *openPagesWidget = OpenPagesManager::instance().openPagesWidget();
openPagesWidget->setWindowTitle(tr("Open Pages")); openPagesWidget->setWindowTitle(tr("Open Pages"));
@@ -740,6 +738,12 @@ void HelpPlugin::activateOpenPages()
m_sideBar->activateItem(m_openPagesItem); m_sideBar->activateItem(m_openPagesItem);
} }
void HelpPlugin::activateBookmarks()
{
activateHelpMode();
m_sideBar->activateItem(m_bookmarkItem);
}
QToolBar *HelpPlugin::createToolBar() QToolBar *HelpPlugin::createToolBar()
{ {
QToolBar *toolWidget = new QToolBar; QToolBar *toolWidget = new QToolBar;

View File

@@ -80,6 +80,7 @@ private slots:
void activateContents(); void activateContents();
void activateSearch(); void activateSearch();
void activateOpenPages(); void activateOpenPages();
void activateBookmarks();
void addBookmark(); void addBookmark();
void updateFilterComboBox(); void updateFilterComboBox();

View File

@@ -230,7 +230,8 @@ bool FolderNavigationWidget::setCurrentDirectory(const QString &directory)
} }
m_listView->setRootIndex(m_filterModel->mapFromSource(index)); m_listView->setRootIndex(m_filterModel->mapFromSource(index));
const QDir current(QDir::cleanPath(newDirectory)); const QDir current(QDir::cleanPath(newDirectory));
setCurrentTitle(current.dirName(), current.absolutePath()); setCurrentTitle(current.dirName(),
QDir::toNativeSeparators(current.absolutePath()));
return !directory.isEmpty(); return !directory.isEmpty();
} }
@@ -253,8 +254,7 @@ void FolderNavigationWidget::openItem(const QModelIndex &srcIndex)
if (fileName == QLatin1String("..")) { if (fileName == QLatin1String("..")) {
// cd up: Special behaviour: The fileInfo of ".." is that of the parent directory. // cd up: Special behaviour: The fileInfo of ".." is that of the parent directory.
const QString parentPath = m_fileSystemModel->fileInfo(srcIndex).absoluteFilePath(); const QString parentPath = m_fileSystemModel->fileInfo(srcIndex).absoluteFilePath();
if (parentPath != QDir::rootPath()) setCurrentDirectory(parentPath);
setCurrentDirectory(parentPath);
return; return;
} }
if (m_fileSystemModel->isDir(srcIndex)) { // Change to directory if (m_fileSystemModel->isDir(srcIndex)) { // Change to directory
@@ -268,8 +268,10 @@ void FolderNavigationWidget::openItem(const QModelIndex &srcIndex)
editorManager->openEditor(m_fileSystemModel->filePath(srcIndex)); editorManager->openEditor(m_fileSystemModel->filePath(srcIndex));
} }
void FolderNavigationWidget::setCurrentTitle(const QString &dirName, const QString &fullPath) void FolderNavigationWidget::setCurrentTitle(QString dirName, const QString &fullPath)
{ {
if (dirName.isEmpty())
dirName = fullPath;
m_title->setText(dirName); m_title->setText(dirName);
m_title->setToolTip(fullPath); m_title->setToolTip(fullPath);
} }

View File

@@ -81,7 +81,7 @@ protected:
virtual void contextMenuEvent(QContextMenuEvent *ev); virtual void contextMenuEvent(QContextMenuEvent *ev);
private: private:
void setCurrentTitle(const QString &dirName, const QString &fullPath); void setCurrentTitle(QString dirName, const QString &fullPath);
bool setCurrentDirectory(const QString &directory); bool setCurrentDirectory(const QString &directory);
void openItem(const QModelIndex &srcIndex); void openItem(const QModelIndex &srcIndex);
QModelIndex currentItem() const; QModelIndex currentItem() const;

View File

@@ -1892,18 +1892,20 @@ void ProjectExplorerPlugin::updateContextMenuActions(Node *node)
d->m_addNewFileAction->setEnabled(false); d->m_addNewFileAction->setEnabled(false);
d->m_removeFileAction->setEnabled(false); d->m_removeFileAction->setEnabled(false);
QList<ProjectNode::ProjectAction> actions = if (node->projectNode()) {
d->m_currentNode->projectNode()->supportedActions(node); QList<ProjectNode::ProjectAction> actions =
d->m_currentNode->projectNode()->supportedActions(node);
if (qobject_cast<FolderNode*>(d->m_currentNode)) { if (qobject_cast<FolderNode*>(d->m_currentNode)) {
bool addFilesEnabled = actions.contains(ProjectNode::AddFile); bool addFilesEnabled = actions.contains(ProjectNode::AddFile);
d->m_addExistingFilesAction->setEnabled(addFilesEnabled); d->m_addExistingFilesAction->setEnabled(addFilesEnabled);
d->m_addNewFileAction->setEnabled(addFilesEnabled); d->m_addNewFileAction->setEnabled(addFilesEnabled);
d->m_renameFileAction->setEnabled(actions.contains(ProjectNode::Rename)); d->m_renameFileAction->setEnabled(actions.contains(ProjectNode::Rename));
} else if (qobject_cast<FileNode*>(d->m_currentNode)) { } else if (qobject_cast<FileNode*>(d->m_currentNode)) {
bool removeFileEnabled = actions.contains(ProjectNode::RemoveFile); bool removeFileEnabled = actions.contains(ProjectNode::RemoveFile);
d->m_removeFileAction->setEnabled(removeFileEnabled); d->m_removeFileAction->setEnabled(removeFileEnabled);
d->m_renameFileAction->setEnabled(actions.contains(ProjectNode::Rename)); d->m_renameFileAction->setEnabled(actions.contains(ProjectNode::Rename));
}
} }
} }

View File

@@ -162,7 +162,6 @@ private slots:
void savePersistentSettings(); void savePersistentSettings();
void goToTaskWindow(); void goToTaskWindow();
void updateContextMenuActions(Node *node);
void addNewFile(); void addNewFile();
void addExistingFiles(); void addExistingFiles();
void openFile(); void openFile();
@@ -202,6 +201,7 @@ private slots:
#endif #endif
private: private:
void updateContextMenuActions(Node *node);
bool parseArguments(const QStringList &arguments, QString *error); bool parseArguments(const QStringList &arguments, QString *error);
void runProjectImpl(Project *pro, QString mode); void runProjectImpl(Project *pro, QString mode);
void executeRunConfiguration(RunConfiguration *, const QString &mode); void executeRunConfiguration(RunConfiguration *, const QString &mode);

View File

@@ -431,25 +431,40 @@ MSVCToolChain::InstallationList MSVCToolChain::installations()
// 2) Installed MSVCs // 2) Installed MSVCs
const QSettings vsRegistry(MSVC_RegKey, QSettings::NativeFormat); const QSettings vsRegistry(MSVC_RegKey, QSettings::NativeFormat);
foreach(const QString &vsName, vsRegistry.allKeys()) { foreach(const QString &vsName, vsRegistry.allKeys()) {
if (vsName.contains(QLatin1Char('.'))) { // Scan for version major.minor const int dotPos = vsName.indexOf(QLatin1Char('.'));
if (dotPos != -1) { // Scan for version major.minor
const QString path = vsRegistry.value(vsName).toString(); const QString path = vsRegistry.value(vsName).toString();
const int version = vsName.left(dotPos).toInt();
// Check existence of various install scripts // Check existence of various install scripts
const QString vcvars32bat = path + QLatin1String("bin\\vcvars32.bat"); const QString vcvars32bat = path + QLatin1String("bin\\vcvars32.bat");
if (QFileInfo(vcvars32bat).isFile()) if (QFileInfo(vcvars32bat).isFile())
installs.push_back(Installation(Installation::VS, vsName, Installation::s32, vcvars32bat)); installs.push_back(Installation(Installation::VS, vsName, Installation::s32, vcvars32bat));
// Amd 64 is the preferred 64bit platform if (version >= 10) {
const QString vcvarsAmd64bat = path + QLatin1String("bin\\amd64\\vcvarsamd64.bat"); // Just one common file
if (QFileInfo(vcvarsAmd64bat).isFile()) const QString vcvarsAllbat = path + QLatin1String("vcvarsall.bat");
installs.push_back(Installation(Installation::VS, vsName, Installation::amd64, vcvarsAmd64bat)); if (QFileInfo(vcvarsAllbat).isFile()) {
const QString vcvarsAmd64bat2 = path + QLatin1String("bin\\vcvarsx86_amd64.bat"); installs.push_back(Installation(Installation::VS, vsName, Installation::s32, vcvarsAllbat, QLatin1String("x86")));
if (QFileInfo(vcvarsAmd64bat2).isFile()) installs.push_back(Installation(Installation::VS, vsName, Installation::amd64, vcvarsAllbat, QLatin1String("amd64")));
installs.push_back(Installation(Installation::VS, vsName, Installation::amd64, vcvarsAmd64bat2)); installs.push_back(Installation(Installation::VS, vsName, Installation::s64, vcvarsAllbat, QLatin1String("x64")));
const QString vcvars64bat = path + QLatin1String("bin\\vcvars64.bat"); installs.push_back(Installation(Installation::VS, vsName, Installation::ia64, vcvarsAllbat, QLatin1String("ia64")));
if (QFileInfo(vcvars64bat).isFile()) } else {
installs.push_back(Installation(Installation::VS, vsName, Installation::s64, vcvars64bat)); qWarning("Unable to find MSVC setup script %s in version %d", qPrintable(vcvarsAllbat), version);
const QString vcvarsIA64bat = path + QLatin1String("bin\\vcvarsx86_ia64.bat"); }
if (QFileInfo(vcvarsIA64bat).isFile()) } else {
installs.push_back(Installation(Installation::VS, vsName, Installation::ia64, vcvarsIA64bat)); // Amd 64 is the preferred 64bit platform
const QString vcvarsAmd64bat = path + QLatin1String("bin\\amd64\\vcvarsamd64.bat");
if (QFileInfo(vcvarsAmd64bat).isFile())
installs.push_back(Installation(Installation::VS, vsName, Installation::amd64, vcvarsAmd64bat));
const QString vcvarsAmd64bat2 = path + QLatin1String("bin\\vcvarsx86_amd64.bat");
if (QFileInfo(vcvarsAmd64bat2).isFile())
installs.push_back(Installation(Installation::VS, vsName, Installation::amd64, vcvarsAmd64bat2));
const QString vcvars64bat = path + QLatin1String("bin\\vcvars64.bat");
if (QFileInfo(vcvars64bat).isFile())
installs.push_back(Installation(Installation::VS, vsName, Installation::s64, vcvars64bat));
const QString vcvarsIA64bat = path + QLatin1String("bin\\vcvarsx86_ia64.bat");
if (QFileInfo(vcvarsIA64bat).isFile())
installs.push_back(Installation(Installation::VS, vsName, Installation::ia64, vcvarsIA64bat));
}
} }
} }
} }

View File

@@ -134,7 +134,7 @@ Internal::ObjectNodeInstance::Pointer NodeInstance::createInstance(const NodeMet
if (!metaInfo.isValid()) if (!metaInfo.isValid())
instance = Internal::DummyNodeInstance::create(); instance = Internal::DummyNodeInstance::create();
else if (metaInfo.isSubclassOf("org.webkit/WebView", 1, 0)) else if (metaInfo.isSubclassOf("QtWebKit/WebView", 1, 0))
instance = Internal::DummyNodeInstance::create(); instance = Internal::DummyNodeInstance::create();
else if (metaInfo.isSubclassOf("Qt/QWidget", 4, 7)) else if (metaInfo.isSubclassOf("Qt/QWidget", 4, 7))
instance = Internal::DummyNodeInstance::create(); instance = Internal::DummyNodeInstance::create();

View File

@@ -130,7 +130,7 @@ void MetaInfoPrivate::loadPlugins(QDeclarativeEngine *engine)
QStringList pluginList; QStringList pluginList;
pluginList += "import Qt 4.7"; pluginList += "import Qt 4.7";
pluginList += "import org.webkit 1.0"; pluginList += "import QtWebKit 1.0";
// load maybe useful plugins // load maybe useful plugins
pluginList += "import Qt.labs.folderlistmodel 1.0"; pluginList += "import Qt.labs.folderlistmodel 1.0";

View File

@@ -111,7 +111,7 @@
</itemlibraryentry> </itemlibraryentry>
</node> </node>
<node name="org.webkit/WebView" icon=":/fxplugin/images/webview-icon16.png"> <node name="QtWebKit/WebView" icon=":/fxplugin/images/webview-icon16.png">
<propertyDefaultValue name="width" type="int" defaultValue="300"/> <propertyDefaultValue name="width" type="int" defaultValue="300"/>
<propertyDefaultValue name="height" type="int" defaultValue="300"/> <propertyDefaultValue name="height" type="int" defaultValue="300"/>
<itemlibraryentry name="Web View" category="Qt - Widgets" icon=":/fxplugin/images/webview-icon.png"> <itemlibraryentry name="Web View" category="Qt - Widgets" icon=":/fxplugin/images/webview-icon.png">

View File

@@ -61,8 +61,10 @@ static const QLatin1String MAEMO_RC_ID_PREFIX(PREFIX ".");
static const QLatin1String ArgumentsKey(PREFIX ".Arguments"); static const QLatin1String ArgumentsKey(PREFIX ".Arguments");
static const QLatin1String SimulatorPathKey(PREFIX ".Simulator"); static const QLatin1String SimulatorPathKey(PREFIX ".Simulator");
static const QLatin1String DeviceIdKey(PREFIX ".DeviceId"); static const QLatin1String DeviceIdKey(PREFIX ".DeviceId");
static const QLatin1String LastDeployedKey(PREFIX ".LastDeployed"); static const QLatin1String LastDeployedHostsKey(PREFIX ".LastDeployedHosts");
static const QLatin1String DebuggingHelpersLastDeployedKey(PREFIX ".DebuggingHelpersLastDeployed"); static const QLatin1String LastDeployedFilesKey(PREFIX ".LastDeployedFiles");
static const QLatin1String LastDeployedRemotePathsKey(PREFIX ".LastDeployedRemotePaths");
static const QLatin1String LastDeployedTimesKey(PREFIX ".LastDeployedTimes");
static const QLatin1String ProFileKey(".ProFile"); static const QLatin1String ProFileKey(".ProFile");
} // namespace Internal } // namespace Internal

View File

@@ -112,12 +112,12 @@ bool MaemoPackageContents::buildModel() const
} }
if (elem == TargetVar) { if (elem == TargetVar) {
m_deployables.prepend(Deployable(m_packageStep->localExecutableFilePath(), m_deployables.prepend(MaemoDeployable(m_packageStep->localExecutableFilePath(),
paths.first())); paths.first()));
targetFound = true; targetFound = true;
} else { } else {
foreach (const QString &file, files) foreach (const QString &file, files)
m_deployables << Deployable(cleanPath(file), paths.first()); m_deployables << MaemoDeployable(cleanPath(file), paths.first());
} }
} }
@@ -125,7 +125,7 @@ bool MaemoPackageContents::buildModel() const
const QString remoteDir = proFileNode->projectType() == LibraryTemplate const QString remoteDir = proFileNode->projectType() == LibraryTemplate
? QLatin1String("/usr/local/lib") ? QLatin1String("/usr/local/lib")
: QLatin1String("/usr/local/bin"); : QLatin1String("/usr/local/bin");
m_deployables.prepend(Deployable(m_packageStep->localExecutableFilePath(), m_deployables.prepend(MaemoDeployable(m_packageStep->localExecutableFilePath(),
remoteDir)); remoteDir));
QString errorString; QString errorString;
if (!readProFileContents(&errorString)) { if (!readProFileContents(&errorString)) {
@@ -144,13 +144,13 @@ bool MaemoPackageContents::buildModel() const
return true; return true;
} }
MaemoPackageContents::Deployable MaemoPackageContents::deployableAt(int row) const MaemoDeployable MaemoPackageContents::deployableAt(int row) const
{ {
Q_ASSERT(row >= 0 && row < rowCount()); Q_ASSERT(row >= 0 && row < rowCount());
return m_deployables.at(row); return m_deployables.at(row);
} }
bool MaemoPackageContents::addDeployable(const Deployable &deployable, bool MaemoPackageContents::addDeployable(const MaemoDeployable &deployable,
QString *error) QString *error)
{ {
if (m_deployables.contains(deployable) || deployableAt(0) == deployable) if (m_deployables.contains(deployable) || deployableAt(0) == deployable)
@@ -179,7 +179,7 @@ bool MaemoPackageContents::removeDeployableAt(int row, QString *error)
{ {
Q_ASSERT(row > 0 && row < rowCount()); Q_ASSERT(row > 0 && row < rowCount());
const Deployable &deployable = deployableAt(row); const MaemoDeployable &deployable = deployableAt(row);
const QString elemToRemove = findInstallsElem(deployable); const QString elemToRemove = findInstallsElem(deployable);
if (elemToRemove.isEmpty()) { if (elemToRemove.isEmpty()) {
*error = tr("Inconsistent model: Deployable not found in .pro file."); *error = tr("Inconsistent model: Deployable not found in .pro file.");
@@ -231,7 +231,7 @@ QVariant MaemoPackageContents::data(const QModelIndex &index, int role) const
if (!index.isValid() || index.row() >= rowCount()) if (!index.isValid() || index.row() >= rowCount())
return QVariant(); return QVariant();
const Deployable &d = deployableAt(index.row()); const MaemoDeployable &d = deployableAt(index.row());
if (index.column() == 0 && role == Qt::DisplayRole) if (index.column() == 0 && role == Qt::DisplayRole)
return d.localFilePath; return d.localFilePath;
if (role == Qt::DisplayRole || role == Qt::EditRole) if (role == Qt::DisplayRole || role == Qt::EditRole)
@@ -260,7 +260,7 @@ bool MaemoPackageContents::setData(const QModelIndex &index,
return false; return false;
} }
Deployable &deployable = m_deployables[index.row()]; MaemoDeployable &deployable = m_deployables[index.row()];
const QString elemToChange = findInstallsElem(deployable); const QString elemToChange = findInstallsElem(deployable);
if (elemToChange.isEmpty()) { if (elemToChange.isEmpty()) {
qWarning("Error: Inconsistent model. " qWarning("Error: Inconsistent model. "
@@ -353,7 +353,7 @@ QString MaemoPackageContents::cleanPath(const QString &relFileName) const
+ relFileName).canonicalFilePath(); + relFileName).canonicalFilePath();
} }
QString MaemoPackageContents::findInstallsElem(const Deployable &deployable) const QString MaemoPackageContents::findInstallsElem(const MaemoDeployable &deployable) const
{ {
const QStringList elems = m_proFileReader->values(InstallsVar, m_proFile); const QStringList elems = m_proFileReader->values(InstallsVar, m_proFile);
foreach (const QString &elem, elems) { foreach (const QString &elem, elems) {

View File

@@ -32,6 +32,7 @@
#include <QtCore/QAbstractTableModel> #include <QtCore/QAbstractTableModel>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QHash>
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QScopedPointer> #include <QtCore/QScopedPointer>
#include <QtCore/QString> #include <QtCore/QString>
@@ -44,6 +45,26 @@ QT_END_NAMESPACE
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
struct MaemoDeployable
{
MaemoDeployable(const QString &localFilePath, const QString &remoteDir)
: localFilePath(localFilePath), remoteDir(remoteDir) {}
bool operator==(const MaemoDeployable &other) const
{
return localFilePath == other.localFilePath
&& remoteDir == other.remoteDir;
}
QString localFilePath;
QString remoteDir;
};
inline uint qHash(const MaemoDeployable &d)
{
return qHash(qMakePair(d.localFilePath, d.remoteDir));
}
class MaemoPackageCreationStep; class MaemoPackageCreationStep;
class ProFileReader; class ProFileReader;
@@ -51,21 +72,6 @@ class MaemoPackageContents : public QAbstractTableModel
{ {
Q_OBJECT Q_OBJECT
public: public:
struct Deployable
{
Deployable(const QString &localFilePath, const QString &remoteDir)
: localFilePath(localFilePath), remoteDir(remoteDir) {}
bool operator==(const Deployable &other) const
{
return localFilePath == other.localFilePath
&& remoteDir == other.remoteDir;
}
QString localFilePath;
QString remoteDir;
};
MaemoPackageContents(MaemoPackageCreationStep *packageStep); MaemoPackageContents(MaemoPackageCreationStep *packageStep);
~MaemoPackageContents(); ~MaemoPackageContents();
@@ -73,8 +79,8 @@ public:
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
Deployable deployableAt(int row) const; MaemoDeployable deployableAt(int row) const;
bool addDeployable(const Deployable &deployable, QString *error); bool addDeployable(const MaemoDeployable &deployable, QString *error);
bool removeDeployableAt(int row, QString *error); bool removeDeployableAt(int row, QString *error);
bool isModified() const { return m_modified; } bool isModified() const { return m_modified; }
void setUnModified() { m_modified = false; } void setUnModified() { m_modified = false; }
@@ -97,7 +103,7 @@ private:
QString cleanPath(const QString &relFileName) const; QString cleanPath(const QString &relFileName) const;
QString findInstallsElem(const Deployable &deployable) const; QString findInstallsElem(const MaemoDeployable &deployable) const;
void addFileToProFile(const QString &var, const QString &absFilePath); void addFileToProFile(const QString &var, const QString &absFilePath);
void addValueToProFile(const QString &var, const QString &value) const; void addValueToProFile(const QString &var, const QString &value) const;
bool removeFileFromProFile(const QString &var, const QString &absFilePath); bool removeFileFromProFile(const QString &var, const QString &absFilePath);
@@ -109,7 +115,7 @@ private:
const MaemoPackageCreationStep * const m_packageStep; const MaemoPackageCreationStep * const m_packageStep;
QScopedPointer<ProFileOption> m_proFileOption; QScopedPointer<ProFileOption> m_proFileOption;
QScopedPointer<ProFileReader> m_proFileReader; QScopedPointer<ProFileReader> m_proFileReader;
mutable QList<Deployable> m_deployables; mutable QList<MaemoDeployable> m_deployables;
mutable bool m_modified; mutable bool m_modified;
mutable ProFile *m_proFile; mutable ProFile *m_proFile;
mutable QStringList m_proFileLines; // TODO: FS watcher mutable QStringList m_proFileLines; // TODO: FS watcher

View File

@@ -66,7 +66,6 @@ MaemoPackageCreationWidget::MaemoPackageCreationWidget(MaemoPackageCreationStep
m_ui->setupUi(this); m_ui->setupUi(this);
m_ui->packageContentsView->setWordWrap(false); m_ui->packageContentsView->setWordWrap(false);
m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled()); m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
m_ui->packageContentsView->setEnabled(m_step->isPackagingEnabled());
m_ui->packageContentsView->setModel(step->packageContents()); m_ui->packageContentsView->setModel(step->packageContents());
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
connect(step->packageContents(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), connect(step->packageContents(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
@@ -105,7 +104,7 @@ void MaemoPackageCreationWidget::addFile()
const QString localFile = QFileDialog::getOpenFileName(this, title, baseDir); // TODO: Support directories? const QString localFile = QFileDialog::getOpenFileName(this, title, baseDir); // TODO: Support directories?
if (localFile.isEmpty()) if (localFile.isEmpty())
return; return;
const MaemoPackageContents::Deployable const MaemoDeployable
deployable(QDir::toNativeSeparators(QFileInfo(localFile).absoluteFilePath()), deployable(QDir::toNativeSeparators(QFileInfo(localFile).absoluteFilePath()),
"/"); "/");
MaemoPackageContents * const contents = m_step->packageContents(); MaemoPackageContents * const contents = m_step->packageContents();
@@ -148,7 +147,6 @@ void MaemoPackageCreationWidget::enableOrDisableRemoveButton()
void MaemoPackageCreationWidget::handleSkipButtonToggled(bool checked) void MaemoPackageCreationWidget::handleSkipButtonToggled(bool checked)
{ {
m_step->setPackagingEnabled(!checked); m_step->setPackagingEnabled(!checked);
m_ui->packageContentsView->setEnabled(m_step->isPackagingEnabled());
} }
} // namespace Internal } // namespace Internal

View File

@@ -23,8 +23,7 @@
<item> <item>
<widget class="QCheckBox" name="skipCheckBox"> <widget class="QCheckBox" name="skipCheckBox">
<property name="toolTip"> <property name="toolTip">
<string>Check this if you build the package externally. It still needs to be at the location listed above <string>Check this if you want the files below to be deployed directly.</string>
and the remote executable is assumed to be in the directory mentioned below.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Skip Packaging Step</string> <string>Skip Packaging Step</string>
@@ -40,7 +39,7 @@ and the remote executable is assumed to be in the directory mentioned below.</st
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Package contents:</string> <string>Files to deploy:</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -68,7 +68,6 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
, m_devConfig(source->m_devConfig) , m_devConfig(source->m_devConfig)
, m_arguments(source->m_arguments) , m_arguments(source->m_arguments)
, m_lastDeployed(source->m_lastDeployed) , m_lastDeployed(source->m_lastDeployed)
, m_debuggingHelpersLastDeployed(source->m_debuggingHelpersLastDeployed)
{ {
init(); init();
} }
@@ -124,25 +123,30 @@ QVariantMap MaemoRunConfiguration::toMap() const
QVariantMap map(RunConfiguration::toMap()); QVariantMap map(RunConfiguration::toMap());
map.insert(DeviceIdKey, m_devConfig.internalId); map.insert(DeviceIdKey, m_devConfig.internalId);
map.insert(ArgumentsKey, m_arguments); map.insert(ArgumentsKey, m_arguments);
addDeployTimesToMap(map);
addDeployTimesToMap(LastDeployedKey, m_lastDeployed, map);
addDeployTimesToMap(DebuggingHelpersLastDeployedKey,
m_debuggingHelpersLastDeployed, map);
const QDir dir = QDir(target()->project()->projectDirectory()); const QDir dir = QDir(target()->project()->projectDirectory());
map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath)); map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath));
return map; return map;
} }
void MaemoRunConfiguration::addDeployTimesToMap(const QString &key, void MaemoRunConfiguration::addDeployTimesToMap(QVariantMap &map) const
const QMap<QString, QDateTime> &deployTimes, QVariantMap &map) const
{ {
QMap<QString, QVariant> variantMap; QVariantList hostList;
QMap<QString, QDateTime>::ConstIterator it = deployTimes.begin(); QVariantList fileList;
for (; it != deployTimes.end(); ++it) QVariantList remotePathList;
variantMap.insert(it.key(), it.value()); QVariantList timeList;
map.insert(key, variantMap); typedef QHash<DeployablePerHost, QDateTime>::ConstIterator DepIt;
for (DepIt it = m_lastDeployed.begin(); it != m_lastDeployed.end(); ++it) {
hostList << it.key().first.localFilePath;
remotePathList << it.key().first.remoteDir;
fileList << it.key().second;
timeList << it.value();
}
map.insert(LastDeployedHostsKey, hostList);
map.insert(LastDeployedFilesKey, fileList);
map.insert(LastDeployedRemotePathsKey, remotePathList);
map.insert(LastDeployedTimesKey, timeList);
} }
bool MaemoRunConfiguration::fromMap(const QVariantMap &map) bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
@@ -153,62 +157,45 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
setDeviceConfig(MaemoDeviceConfigurations::instance(). setDeviceConfig(MaemoDeviceConfigurations::instance().
find(map.value(DeviceIdKey, 0).toInt())); find(map.value(DeviceIdKey, 0).toInt()));
m_arguments = map.value(ArgumentsKey).toStringList(); m_arguments = map.value(ArgumentsKey).toStringList();
getDeployTimesFromMap(map);
getDeployTimesFromMap(LastDeployedKey, m_lastDeployed, map);
getDeployTimesFromMap(DebuggingHelpersLastDeployedKey,
m_debuggingHelpersLastDeployed, map);
const QDir dir = QDir(target()->project()->projectDirectory()); const QDir dir = QDir(target()->project()->projectDirectory());
m_proFilePath = dir.filePath(map.value(ProFileKey).toString()); m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
return true; return true;
} }
void MaemoRunConfiguration::getDeployTimesFromMap(const QString &key, void MaemoRunConfiguration::getDeployTimesFromMap(const QVariantMap &map)
QMap<QString, QDateTime> &deployTimes, const QVariantMap &map)
{ {
const QVariantMap &variantMap = map.value(key).toMap(); const QVariantList &hostList = map.value(LastDeployedHostsKey).toList();
for (QVariantMap::ConstIterator it = variantMap.begin(); const QVariantList &fileList = map.value(LastDeployedFilesKey).toList();
it != variantMap.end(); ++it) const QVariantList &remotePathList
deployTimes.insert(it.key(), it.value().toDateTime()); = map.value(LastDeployedRemotePathsKey).toList();
} const QVariantList &timeList = map.value(LastDeployedTimesKey).toList();
const int elemCount
bool MaemoRunConfiguration::currentlyNeedsDeployment(const QString &host) const = qMin(qMin(hostList.size(), fileList.size()),
{ qMin(remotePathList.size(), timeList.size()));
return fileNeedsDeployment(packageStep()->packageFilePath(), for (int i = 0; i < elemCount; ++i) {
m_lastDeployed.value(host)); const MaemoDeployable d(fileList.at(i).toString(),
} remotePathList.at(i).toString());
m_lastDeployed.insert(DeployablePerHost(d, hostList.at(i).toString()),
void MaemoRunConfiguration::wasDeployed(const QString &host) timeList.at(i).toDateTime());
{
m_lastDeployed.insert(host, QDateTime::currentDateTime());
}
bool MaemoRunConfiguration::hasDebuggingHelpers() const
{
Qt4BuildConfiguration *qt4bc = activeQt4BuildConfiguration();
return qt4bc->qtVersion()->hasDebuggingHelper();
}
bool MaemoRunConfiguration::debuggingHelpersNeedDeployment(const QString &host) const
{
if (hasDebuggingHelpers()) {
return fileNeedsDeployment(dumperLib(),
m_debuggingHelpersLastDeployed.value(host));
} }
return false;
} }
void MaemoRunConfiguration::debuggingHelpersDeployed(const QString &host) bool MaemoRunConfiguration::currentlyNeedsDeployment(const QString &host,
{ const MaemoDeployable &deployable) const
m_debuggingHelpersLastDeployed.insert(host, QDateTime::currentDateTime());
}
bool MaemoRunConfiguration::fileNeedsDeployment(const QString &path,
const QDateTime &lastDeployed) const
{ {
const QDateTime &lastDeployed
= m_lastDeployed.value(DeployablePerHost(deployable, host));
return !lastDeployed.isValid() return !lastDeployed.isValid()
|| QFileInfo(path).lastModified() > lastDeployed; || QFileInfo(deployable.localFilePath).lastModified() > lastDeployed;
}
void MaemoRunConfiguration::setDeployed(const QString &host,
const MaemoDeployable &deployable)
{
m_lastDeployed.insert(DeployablePerHost(deployable, host),
QDateTime::currentDateTime());
} }
void MaemoRunConfiguration::setDeviceConfig(const MaemoDeviceConfig &devConf) void MaemoRunConfiguration::setDeviceConfig(const MaemoDeviceConfig &devConf)
@@ -322,7 +309,7 @@ void MaemoRunConfiguration::updateDeviceConfigurations()
} else { } else {
m_devConfig = configManager.find(m_devConfig.internalId); m_devConfig = configManager.find(m_devConfig.internalId);
} }
emit deviceConfigurationsUpdated(); emit deviceConfigurationsUpdated(target());
} }
} // namespace Internal } // namespace Internal

View File

@@ -32,6 +32,7 @@
#include "maemoconstants.h" #include "maemoconstants.h"
#include "maemodeviceconfigurations.h" #include "maemodeviceconfigurations.h"
#include "maemopackagecontents.h"
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
@@ -69,12 +70,9 @@ public:
Qt4Target *qt4Target() const; Qt4Target *qt4Target() const;
Qt4BuildConfiguration *activeQt4BuildConfiguration() const; Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
bool currentlyNeedsDeployment(const QString &host) const; bool currentlyNeedsDeployment(const QString &host,
void wasDeployed(const QString &host); const MaemoDeployable &deployable) const;
void setDeployed(const QString &host, const MaemoDeployable &deployable);
bool hasDebuggingHelpers() const;
bool debuggingHelpersNeedDeployment(const QString &host) const;
void debuggingHelpersDeployed(const QString &host);
const MaemoPackageCreationStep *packageStep() const; const MaemoPackageCreationStep *packageStep() const;
@@ -94,7 +92,7 @@ public:
virtual QVariantMap toMap() const; virtual QVariantMap toMap() const;
signals: signals:
void deviceConfigurationsUpdated(); void deviceConfigurationsUpdated(ProjectExplorer::Target *target);
void deviceConfigurationChanged(ProjectExplorer::Target *target); void deviceConfigurationChanged(ProjectExplorer::Target *target);
void targetInformationChanged() const; void targetInformationChanged() const;
@@ -109,13 +107,8 @@ private slots:
private: private:
void init(); void init();
const MaemoToolChain *toolchain() const; const MaemoToolChain *toolchain() const;
bool fileNeedsDeployment(const QString &path, const QDateTime &lastDeployed) const; void addDeployTimesToMap(QVariantMap &map) const;
void addDeployTimesToMap(const QString &key, void getDeployTimesFromMap(const QVariantMap &map);
const QMap<QString, QDateTime> &deployTimes,
QVariantMap &map) const;
void getDeployTimesFromMap(const QString &key,
QMap<QString, QDateTime> &deployTimes,
const QVariantMap &map);
QString m_proFilePath; QString m_proFilePath;
mutable QString m_gdbPath; mutable QString m_gdbPath;
@@ -123,9 +116,8 @@ private:
MaemoDeviceConfig m_devConfig; MaemoDeviceConfig m_devConfig;
QStringList m_arguments; QStringList m_arguments;
// These map host names to deploy times. typedef QPair<MaemoDeployable, QString> DeployablePerHost;
QMap<QString, QDateTime> m_lastDeployed; QHash<DeployablePerHost, QDateTime> m_lastDeployed;
QMap<QString, QDateTime> m_debuggingHelpersLastDeployed;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -89,7 +89,7 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
mainLayout->addRow(tr("Arguments:"), m_argsLineEdit); mainLayout->addRow(tr("Arguments:"), m_argsLineEdit);
resetDeviceConfigurations(); resetDeviceConfigurations();
connect(m_runConfiguration, SIGNAL(deviceConfigurationsUpdated()), connect(m_runConfiguration, SIGNAL(deviceConfigurationsUpdated(ProjectExplorer::Target *)),
this, SLOT(resetDeviceConfigurations())); this, SLOT(resetDeviceConfigurations()));
connect(m_configNameLineEdit, SIGNAL(textEdited(QString)), this, connect(m_configNameLineEdit, SIGNAL(textEdited(QString)), this,

View File

@@ -34,10 +34,10 @@
#include "maemoruncontrol.h" #include "maemoruncontrol.h"
#include "maemopackagecontents.h"
#include "maemopackagecreationstep.h" #include "maemopackagecreationstep.h"
#include "maemosshthread.h" #include "maemosshthread.h"
#include "maemorunconfiguration.h" #include "maemorunconfiguration.h"
#include "maemopackagecontents.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
@@ -49,6 +49,7 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <QtCore/QCryptographicHash>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <QtCore/QFuture> #include <QtCore/QFuture>
@@ -129,26 +130,54 @@ void AbstractMaemoRunControl::startDeployment(bool forDebugging)
if (m_stoppedByUser) { if (m_stoppedByUser) {
emit finished(); emit finished();
} else { } else {
m_needsInstall = false;
m_deployables.clear(); m_deployables.clear();
if (m_runConfig->currentlyNeedsDeployment(m_devConfig.server.host)) { m_remoteLinks.clear();
m_deployables.append(Deployable(packageFileName(), const MaemoPackageCreationStep * const packageStep
QFileInfo(executableOnHost()).canonicalPath(), = m_runConfig->packageStep();
&MaemoRunConfiguration::wasDeployed)); if (packageStep->isPackagingEnabled()) {
m_needsInstall = true; const MaemoDeployable d(packageFilePath(), remoteDir());
m_needsInstall = addDeployableIfNeeded(d);
} else { } else {
m_needsInstall = false; const MaemoPackageContents * const packageContents
} = packageStep->packageContents();
if (forDebugging for (int i = 0; i < packageContents->rowCount(); ++i) {
&& m_runConfig->debuggingHelpersNeedDeployment(m_devConfig.server.host)) { const MaemoDeployable &d = packageContents->deployableAt(i);
const QFileInfo &info(m_runConfig->dumperLib()); if (addDeployableIfNeeded(d))
m_deployables.append(Deployable(info.fileName(), info.canonicalPath(), m_needsInstall = true;
&MaemoRunConfiguration::debuggingHelpersDeployed)); }
} }
if (forDebugging) {
QFileInfo dumperInfo(m_runConfig->dumperLib());
if (dumperInfo.exists()) {
const MaemoDeployable d(m_runConfig->dumperLib(), remoteDir());
m_needsInstall = addDeployableIfNeeded(d);
}
}
deploy(); deploy();
} }
} }
bool AbstractMaemoRunControl::addDeployableIfNeeded(const MaemoDeployable &deployable)
{
if (m_runConfig->currentlyNeedsDeployment(m_devConfig.server.host,
deployable)) {
const QString fileName
= QFileInfo(deployable.localFilePath).fileName();
const QString remoteFilePath = deployable.remoteDir + '/' + fileName;
const QString sftpTargetFilePath = remoteDir() + '/' + fileName + '.'
+ QCryptographicHash::hash(remoteFilePath.toUtf8(),
QCryptographicHash::Md5).toHex();
m_deployables.append(MaemoDeployable(deployable.localFilePath,
sftpTargetFilePath));
m_remoteLinks.insert(sftpTargetFilePath, remoteFilePath); // TODO fix merge mess
return true;
} else {
return false;
}
}
void AbstractMaemoRunControl::deploy() void AbstractMaemoRunControl::deploy()
{ {
Core::ICore::instance()->progressManager() Core::ICore::instance()->progressManager()
@@ -157,14 +186,12 @@ void AbstractMaemoRunControl::deploy()
if (!m_deployables.isEmpty()) { if (!m_deployables.isEmpty()) {
QList<Core::SftpTransferInfo> deploySpecs; QList<Core::SftpTransferInfo> deploySpecs;
QStringList files; QStringList files;
foreach (const Deployable &deployable, m_deployables) { foreach (const MaemoDeployable &deployable, m_deployables) {
const QString srcFilePath files << deployable.localFilePath;
= deployable.dir % QDir::separator() % deployable.fileName; const QString remoteFilePath = deployable.remoteDir + '/' + QFileInfo(deployable.localFilePath).fileName();
const QString tgtFilePath deploySpecs << Core::SftpTransferInfo(deployable.localFilePath,
= remoteDir() % QDir::separator() % deployable.fileName; remoteFilePath.toUtf8(),
files << srcFilePath; Core::SftpTransferInfo::Upload);
deploySpecs << Core::SftpTransferInfo(srcFilePath,
tgtFilePath.toUtf8(), Core::SftpTransferInfo::Upload);
} }
emit appendMessage(this, tr("Files to deploy: %1.").arg(files.join(" ")), false); emit appendMessage(this, tr("Files to deploy: %1.").arg(files.join(" ")), false);
m_sshDeployer.reset(new MaemoSshDeployer(m_devConfig.server, deploySpecs)); m_sshDeployer.reset(new MaemoSshDeployer(m_devConfig.server, deploySpecs));
@@ -184,8 +211,10 @@ void AbstractMaemoRunControl::deploy()
void AbstractMaemoRunControl::handleFileCopied() void AbstractMaemoRunControl::handleFileCopied()
{ {
Deployable deployable = m_deployables.takeFirst(); const MaemoDeployable &deployable = m_deployables.takeFirst();
(m_runConfig->*deployable.updateTimestamp)(m_devConfig.server.host); m_runConfig->setDeployed(m_devConfig.server.host,
MaemoDeployable(deployable.localFilePath,
m_remoteLinks.value(deployable.remoteDir))); // TODO fix merge mess
m_progress.setProgressValue(m_progress.progressValue() + 1); m_progress.setProgressValue(m_progress.progressValue() + 1);
} }
@@ -324,8 +353,21 @@ QString AbstractMaemoRunControl::remoteSudo() const
QString AbstractMaemoRunControl::remoteInstallCommand() const QString AbstractMaemoRunControl::remoteInstallCommand() const
{ {
return QString::fromLocal8Bit("%1 dpkg -i %2").arg(remoteSudo()) Q_ASSERT(m_needsInstall);
.arg(packageFileName()); QString cmd;
for (QMap<QString, QString>::ConstIterator it = m_remoteLinks.begin();
it != m_remoteLinks.end(); ++it) {
cmd += QString::fromLocal8Bit("%1 ln -sf %2 %3 && ")
.arg(remoteSudo(), it.key(), it.value());
}
if (m_runConfig->packageStep()->isPackagingEnabled()) {
cmd += QString::fromLocal8Bit("%1 dpkg -i %2").arg(remoteSudo())
.arg(packageFileName());
} else if (!m_remoteLinks.isEmpty()) {
return cmd.remove(cmd.length() - 4, 4); // Trailing " && "
}
return cmd;
} }
const QString AbstractMaemoRunControl::targetCmdLinePrefix() const const QString AbstractMaemoRunControl::targetCmdLinePrefix() const

View File

@@ -36,6 +36,7 @@
#define MAEMORUNCONTROL_H #define MAEMORUNCONTROL_H
#include "maemodeviceconfigurations.h" #include "maemodeviceconfigurations.h"
#include "maemopackagecontents.h"
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
@@ -99,6 +100,8 @@ protected:
const MaemoDeviceConfig m_devConfig; const MaemoDeviceConfig m_devConfig;
private: private:
bool addDeployableIfNeeded(const MaemoDeployable &deployable);
virtual void startInternal()=0; virtual void startInternal()=0;
virtual void stopInternal()=0; virtual void stopInternal()=0;
virtual QString remoteCall() const=0; virtual QString remoteCall() const=0;
@@ -117,16 +120,8 @@ private:
QScopedPointer<MaemoSshRunner> m_initialCleaner; QScopedPointer<MaemoSshRunner> m_initialCleaner;
bool m_stoppedByUser; bool m_stoppedByUser;
struct Deployable QList<MaemoDeployable> m_deployables;
{ QMap<QString, QString> m_remoteLinks;
typedef void (MaemoRunConfiguration::*updateFunc)(const QString&);
Deployable(const QString &f, const QString &d, updateFunc u)
: fileName(f), dir(d), updateTimestamp(u) {}
QString fileName;
QString dir;
updateFunc updateTimestamp;
};
QList<Deployable> m_deployables;
bool m_needsInstall; bool m_needsInstall;
}; };

View File

@@ -199,7 +199,7 @@ void QemuRuntimeManager::projectRemoved(ProjectExplorer::Project *project)
void QemuRuntimeManager::projectChanged(ProjectExplorer::Project *project) void QemuRuntimeManager::projectChanged(ProjectExplorer::Project *project)
{ {
if (project) if (project)
toogleStarterButton(project->activeTarget()); toggleStarterButton(project->activeTarget());
} }
bool targetIsMaemo(const QString &id) bool targetIsMaemo(const QString &id)
@@ -231,13 +231,8 @@ void QemuRuntimeManager::targetAdded(ProjectExplorer::Target *target)
// handle the qt version changes the build configuration uses // handle the qt version changes the build configuration uses
connect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged())); connect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
foreach (RunConfiguration *runConfig, target->runConfigurations()) { foreach (RunConfiguration *rc, target->runConfigurations())
MaemoRunConfiguration *mrc = qobject_cast<MaemoRunConfiguration *> (runConfig); toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), true);
if (mrc) { // handle device configuration change too
connect(mrc, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
}
}
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget()); m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
} }
@@ -262,44 +257,29 @@ void QemuRuntimeManager::targetRemoved(ProjectExplorer::Target *target)
disconnect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged())); disconnect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
foreach (RunConfiguration *runConfig, target->runConfigurations()) { foreach (RunConfiguration *rc, target->runConfigurations())
MaemoRunConfiguration *mrc = qobject_cast<MaemoRunConfiguration *> (runConfig); toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), false);
if (mrc) {
disconnect(mrc, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
}
}
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget()); m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
} }
void QemuRuntimeManager::targetChanged(ProjectExplorer::Target *target) void QemuRuntimeManager::targetChanged(ProjectExplorer::Target *target)
{ {
if (target) if (target)
toogleStarterButton(target); toggleStarterButton(target);
} }
void QemuRuntimeManager::runConfigurationAdded(ProjectExplorer::RunConfiguration *rc) void QemuRuntimeManager::runConfigurationAdded(ProjectExplorer::RunConfiguration *rc)
{ {
if (!rc || !targetIsMaemo(rc->target()->id())) if (!rc || !targetIsMaemo(rc->target()->id()))
return; return;
toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), true);
MaemoRunConfiguration *mrc = qobject_cast<MaemoRunConfiguration *> (rc);
if (mrc) { // handle device configuration change too
connect(mrc, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
}
} }
void QemuRuntimeManager::runConfigurationRemoved(ProjectExplorer::RunConfiguration *rc) void QemuRuntimeManager::runConfigurationRemoved(ProjectExplorer::RunConfiguration *rc)
{ {
if (!rc || rc->target()->id() != QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)) if (!rc || rc->target()->id() != QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID))
return; return;
toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), false);
MaemoRunConfiguration *mrc = qobject_cast<MaemoRunConfiguration *> (rc);
if (mrc) {
disconnect(mrc, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
}
} }
void QemuRuntimeManager::runConfigurationChanged(ProjectExplorer::RunConfiguration *rc) void QemuRuntimeManager::runConfigurationChanged(ProjectExplorer::RunConfiguration *rc)
@@ -327,7 +307,7 @@ void QemuRuntimeManager::buildConfigurationRemoved(ProjectExplorer::BuildConfigu
void QemuRuntimeManager::buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc) void QemuRuntimeManager::buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc)
{ {
if (bc) if (bc)
toogleStarterButton(bc->target()); toggleStarterButton(bc->target());
} }
void QemuRuntimeManager::environmentChanged() void QemuRuntimeManager::environmentChanged()
@@ -335,7 +315,7 @@ void QemuRuntimeManager::environmentChanged()
// likely to happen when the qt version changes the build config is using // likely to happen when the qt version changes the build config is using
if (ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance()) { if (ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance()) {
if (Project *project = explorer->session()->startupProject()) if (Project *project = explorer->session()->startupProject())
toogleStarterButton(project->activeTarget()); toggleStarterButton(project->activeTarget());
} }
} }
@@ -492,7 +472,7 @@ void QemuRuntimeManager::updateStarterIcon(bool running)
state)); state));
} }
void QemuRuntimeManager::toogleStarterButton(Target *target) void QemuRuntimeManager::toggleStarterButton(Target *target)
{ {
if (m_needsSetup) if (m_needsSetup)
setupRuntimes(); setupRuntimes();
@@ -619,3 +599,22 @@ QString QemuRuntimeManager::runtimeForQtVersion(const QString &qmakeCommand) con
} }
return QString(); return QString();
} }
void QemuRuntimeManager::toggleDeviceConnections(MaemoRunConfiguration *mrc,
bool _connect)
{
if (!mrc)
return;
if (_connect) { // handle device configuration changes
connect(mrc, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
connect(mrc, SIGNAL(deviceConfigurationsUpdated(ProjectExplorer::Target*)),
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
} else {
disconnect(mrc, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
disconnect(mrc, SIGNAL(deviceConfigurationsUpdated(ProjectExplorer::Target*)),
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
}
}

View File

@@ -51,6 +51,7 @@ namespace ProjectExplorer {
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
class QtVersion; class QtVersion;
namespace Internal { namespace Internal {
class MaemoRunConfiguration;
struct Runtime struct Runtime
{ {
@@ -115,7 +116,7 @@ private:
bool sessionHasMaemoTarget() const; bool sessionHasMaemoTarget() const;
void updateStarterIcon(bool running); void updateStarterIcon(bool running);
void toogleStarterButton(ProjectExplorer::Target *target); void toggleStarterButton(ProjectExplorer::Target *target);
bool targetUsesRuntimeConfig(ProjectExplorer::Target *target); bool targetUsesRuntimeConfig(ProjectExplorer::Target *target);
QString maddeRoot(const QString &qmake) const; QString maddeRoot(const QString &qmake) const;
@@ -124,6 +125,8 @@ private:
bool fillRuntimeInformation(Runtime *runtime) const; bool fillRuntimeInformation(Runtime *runtime) const;
QString runtimeForQtVersion(const QString &qmakeCommand) const; QString runtimeForQtVersion(const QString &qmakeCommand) const;
void toggleDeviceConnections(MaemoRunConfiguration *mrc, bool connect);
private: private:
QAction *m_qemuAction; QAction *m_qemuAction;
QProcess *m_qemuProcess; QProcess *m_qemuProcess;

View File

@@ -1,5 +1,4 @@
!isEmpty(SUPPORT_QT_S60) { !isEmpty(SUPPORT_QT_S60) {
message("Adding experimental support for Qt Symbian applications.")
DEFINES += QTCREATOR_WITH_S60 DEFINES += QTCREATOR_WITH_S60
} }
SOURCES += $$PWD/s60devices.cpp \ SOURCES += $$PWD/s60devices.cpp \

View File

@@ -105,10 +105,6 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
connect(project, SIGNAL(buildDirectoryInitialized()), connect(project, SIGNAL(buildDirectoryInitialized()),
this, SLOT(updateImportLabel())); this, SLOT(updateImportLabel()));
QtVersionManager *vm = QtVersionManager::instance();
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
this, SLOT(qtVersionsChanged()));
} }
Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget() Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget()
@@ -196,6 +192,9 @@ void Qt4ProjectConfigWidget::init(ProjectExplorer::BuildConfiguration *bc)
m_ui->nameLineEdit->setText(m_buildConfiguration->displayName()); m_ui->nameLineEdit->setText(m_buildConfiguration->displayName());
qtVersionsChanged(); qtVersionsChanged();
QtVersionManager *vm = QtVersionManager::instance();
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
this, SLOT(qtVersionsChanged()));
bool shadowBuild = m_buildConfiguration->shadowBuild(); bool shadowBuild = m_buildConfiguration->shadowBuild();
m_ui->shadowBuildCheckBox->setChecked(shadowBuild); m_ui->shadowBuildCheckBox->setChecked(shadowBuild);
@@ -215,6 +214,11 @@ void Qt4ProjectConfigWidget::qtVersionChanged()
if (m_ignoreChange) if (m_ignoreChange)
return; return;
int versionId = m_buildConfiguration->qtVersion()->uniqueId();
int comboBoxIndex = m_ui->qtVersionComboBox->findData(QVariant(versionId), Qt::UserRole);
if (comboBoxIndex > -1)
m_ui->qtVersionComboBox->setCurrentIndex(comboBoxIndex);
updateShadowBuildUi(); updateShadowBuildUi();
updateImportLabel(); updateImportLabel();
updateToolChainCombo(); updateToolChainCombo();
@@ -228,9 +232,6 @@ void Qt4ProjectConfigWidget::configNameEdited(const QString &newName)
void Qt4ProjectConfigWidget::qtVersionsChanged() void Qt4ProjectConfigWidget::qtVersionsChanged()
{ {
if (!m_buildConfiguration) // not yet initialized
return;
m_ignoreChange = true; m_ignoreChange = true;
QtVersionManager *vm = QtVersionManager::instance(); QtVersionManager *vm = QtVersionManager::instance();
@@ -396,7 +397,6 @@ void Qt4ProjectConfigWidget::importLabelClicked()
// So we got all the information now apply it... // So we got all the information now apply it...
m_buildConfiguration->setQtVersion(version); m_buildConfiguration->setQtVersion(version);
// Combo box will be updated at the end
QMakeStep *qmakeStep = m_buildConfiguration->qmakeStep(); QMakeStep *qmakeStep = m_buildConfiguration->qmakeStep();
qmakeStep->setUserArguments(additionalArguments); qmakeStep->setUserArguments(additionalArguments);

View File

@@ -268,7 +268,7 @@ int main(int argc, char *argv[])
importCode += "import Qt.labs.particles 4.7;\n"; importCode += "import Qt.labs.particles 4.7;\n";
importCode += "import Qt.labs.gestures 4.7;\n"; importCode += "import Qt.labs.gestures 4.7;\n";
importCode += "import Qt.labs.folderlistmodel 4.7;\n"; importCode += "import Qt.labs.folderlistmodel 4.7;\n";
importCode += "import org.webkit 1.0;\n"; importCode += "import QtWebKit 1.0;\n";
if (!pluginImportName.isEmpty()) if (!pluginImportName.isEmpty())
importCode += QString("import %0 1.0;\n").arg(pluginImportName).toAscii(); importCode += QString("import %0 1.0;\n").arg(pluginImportName).toAscii();

View File

@@ -803,10 +803,10 @@ void TestCore::testRewriterImports()
QVERIFY(!import.hasVersion()); QVERIFY(!import.hasVersion());
QVERIFY(!import.hasAlias()); QVERIFY(!import.hasAlias());
// import org.webkit 1.0 as Web // import QtWebKit 1.0 as Web
import = model->imports().at(2); import = model->imports().at(2);
QVERIFY(import.isLibraryImport()); QVERIFY(import.isLibraryImport());
QCOMPARE(import.url(), QString("org.webkit")); QCOMPARE(import.url(), QString("QtWebKit"));
QVERIFY(import.hasVersion()); QVERIFY(import.hasVersion());
QCOMPARE(import.version(), QString("1.0")); QCOMPARE(import.version(), QString("1.0"));
QVERIFY(import.hasAlias()); QVERIFY(import.hasAlias());
@@ -835,12 +835,12 @@ void TestCore::testRewriterChangeImports()
// //
// Add / Remove an import in the model // Add / Remove an import in the model
// //
Import webkitImport = Import::createLibraryImport("org.webkit", "1.0"); Import webkitImport = Import::createLibraryImport("QtWebKit", "1.0");
model->addImport(webkitImport); model->addImport(webkitImport);
const QLatin1String qmlWithImport("\n" const QLatin1String qmlWithImport("\n"
"import Qt 4.7\n" "import Qt 4.7\n"
"import org.webkit 1.0\n" "import QtWebKit 1.0\n"
"\n" "\n"
"Rectangle {}\n"); "Rectangle {}\n");
QCOMPARE(textEdit.toPlainText(), qmlWithImport); QCOMPARE(textEdit.toPlainText(), qmlWithImport);
@@ -856,12 +856,12 @@ void TestCore::testRewriterChangeImports()
// //
// Add / Remove an import in the model (with alias) // Add / Remove an import in the model (with alias)
// //
webkitImport = Import::createLibraryImport("org.webkit", "1.0", "Web"); webkitImport = Import::createLibraryImport("QtWebKit", "1.0", "Web");
model->addImport(webkitImport); model->addImport(webkitImport);
const QLatin1String qmlWithAliasImport("\n" const QLatin1String qmlWithAliasImport("\n"
"import Qt 4.7\n" "import Qt 4.7\n"
"import org.webkit 1.0 as Web\n" "import QtWebKit 1.0 as Web\n"
"\n" "\n"
"Rectangle {}\n"); "Rectangle {}\n");
QCOMPARE(textEdit.toPlainText(), qmlWithAliasImport); QCOMPARE(textEdit.toPlainText(), qmlWithAliasImport);
@@ -880,12 +880,12 @@ void TestCore::testRewriterChangeImports()
textEdit.setPlainText(qmlWithImport); textEdit.setPlainText(qmlWithImport);
QCOMPARE(model->imports().size(), 2); QCOMPARE(model->imports().size(), 2);
QCOMPARE(model->imports().first(), Import::createLibraryImport("Qt", "4.7")); QCOMPARE(model->imports().first(), Import::createLibraryImport("Qt", "4.7"));
QCOMPARE(model->imports().last(), Import::createLibraryImport("org.webkit", "1.0")); QCOMPARE(model->imports().last(), Import::createLibraryImport("QtWebKit", "1.0"));
textEdit.setPlainText(qmlWithAliasImport); textEdit.setPlainText(qmlWithAliasImport);
QCOMPARE(model->imports().size(), 2); QCOMPARE(model->imports().size(), 2);
QCOMPARE(model->imports().first(), Import::createLibraryImport("Qt", "4.7")); QCOMPARE(model->imports().first(), Import::createLibraryImport("Qt", "4.7"));
QCOMPARE(model->imports().last(), Import::createLibraryImport("org.webkit", "1.0", "Web")); QCOMPARE(model->imports().last(), Import::createLibraryImport("QtWebKit", "1.0", "Web"));
textEdit.setPlainText(qmlString); textEdit.setPlainText(qmlString);
QCOMPARE(model->imports().size(), 1); QCOMPARE(model->imports().size(), 1);
@@ -3709,7 +3709,7 @@ void TestCore::testMetaInfo()
QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item", 4, 7)); QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item", 4, 7));
// test whether types from plugins are registered // test whether types from plugins are registered
QVERIFY(model->metaInfo().hasNodeMetaInfo("org.webkit/WebView", 1, 0)); QVERIFY(model->metaInfo().hasNodeMetaInfo("QtWebKit/WebView", 1, 0));
// test whether non-qml type is registered // test whether non-qml type is registered
QVERIFY(model->metaInfo().hasNodeMetaInfo("QGraphicsObject", 4, 7)); // Qt 4.7 namespace QVERIFY(model->metaInfo().hasNodeMetaInfo("QGraphicsObject", 4, 7)); // Qt 4.7 namespace

View File

@@ -1,6 +1,6 @@
import Qt 4.7 import Qt 4.7
import "subitems" import "subitems"
import org.webkit 1.0 as Web import QtWebKit 1.0 as Web
Rectangle { Rectangle {
} }

View File

@@ -1,4 +1,4 @@
import org.webkit 1.0 import QtWebKit 1.0
// Test loading of import libraries // Test loading of import libraries
WebView { WebView {