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:
* Open Source front-end for C++ (license MIT), enhanced for use in Qt Creator
Roberto Raggi <roberto.raggi@gmail.com>
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 \
QT_DEPRECATED \
Q_NO_USING_KEYWORD \
__cplusplus
__cplusplus \
qtquick
versionsym = QT_VERSION_STR
@@ -38,6 +39,7 @@ extraimages.HTML = qt-logo \
feedbackground.png \
horBar.png \
page_bg.png \
page.png \
sprites-combined.png \
qtcreator-screenshots.png

View File

@@ -18,8 +18,12 @@
and developers to create applications for multiple desktop and mobile device
platforms.
For application designers, Qt Creator provides two integrated
visual editors, \QD and \QMLD, that you can use to design and develop
For application designers, Qt Creator provides integrated
visual editors, \QD
\if defined(qtquick)
and \QMLD,
\endif
that you can use to design and develop
application user interfaces.
For application developers,
@@ -4990,7 +4994,7 @@
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.
Similarly, using the \SubItem class helps to protect individual items.
Similarly, using the \c SubItem class helps to protect individual items.
Example:
\code
@@ -7267,7 +7271,7 @@
report them as bugs.
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

View File

@@ -53,6 +53,7 @@ qhp.QtCreator.extraFiles = \
images/feedbackground.png \
images/horBar.png \
images/page_bg.png \
images/page.png \
images/qt-logo.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
{
padding: 30px;
word-wrap:break-word;
word-wrap: break-word;
}
.wrap .content li
@@ -472,11 +472,32 @@
/* 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;
}
.wrap .content ol img {
vertical-align: middle;
}
.wrap .content ul img {
vertical-align: middle;
}
.wrap .content h1
{
font: 600 18px/1.2 Arial;
@@ -676,9 +697,9 @@
.shortCut-topleft-inactive
{
padding-left: 3px;
padding-right: 3px;
background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px;
height: 20px;
width: 110px;
}
.shortCut-topleft-inactive span
{
@@ -698,7 +719,6 @@
{
list-style-type: none;
float: left;
width: 347px;
margin-left: 100px;
}
#shortCut li

View File

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

View File

@@ -11,4 +11,3 @@ TEMPLATE = subdirs
CONFIG += ordered
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)
LANGUAGES = de pl ru
#LANGUAGES = cs es fr hu it ja sl
LANGUAGES = de ja pl ru
#LANGUAGES = cs es fr hu it sl
# var, prepend, append
defineReplace(prependAll) {

View File

@@ -187,17 +187,6 @@ int main(int argc, char **argv)
// Must be done before any QSettings class is created
QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope,
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
const QSettings settings(QSettings::IniFormat, QSettings::UserScope,
QLatin1String("Nokia"), QLatin1String("QtCreator"));

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -431,25 +431,40 @@ MSVCToolChain::InstallationList MSVCToolChain::installations()
// 2) Installed MSVCs
const QSettings vsRegistry(MSVC_RegKey, QSettings::NativeFormat);
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 int version = vsName.left(dotPos).toInt();
// Check existence of various install scripts
const QString vcvars32bat = path + QLatin1String("bin\\vcvars32.bat");
if (QFileInfo(vcvars32bat).isFile())
installs.push_back(Installation(Installation::VS, vsName, Installation::s32, vcvars32bat));
// 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));
if (version >= 10) {
// Just one common file
const QString vcvarsAllbat = path + QLatin1String("vcvarsall.bat");
if (QFileInfo(vcvarsAllbat).isFile()) {
installs.push_back(Installation(Installation::VS, vsName, Installation::s32, vcvarsAllbat, QLatin1String("x86")));
installs.push_back(Installation(Installation::VS, vsName, Installation::amd64, vcvarsAllbat, QLatin1String("amd64")));
installs.push_back(Installation(Installation::VS, vsName, Installation::s64, vcvarsAllbat, QLatin1String("x64")));
installs.push_back(Installation(Installation::VS, vsName, Installation::ia64, vcvarsAllbat, QLatin1String("ia64")));
} else {
qWarning("Unable to find MSVC setup script %s in version %d", qPrintable(vcvarsAllbat), version);
}
} else {
// 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())
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();
else if (metaInfo.isSubclassOf("Qt/QWidget", 4, 7))
instance = Internal::DummyNodeInstance::create();

View File

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

View File

@@ -111,7 +111,7 @@
</itemlibraryentry>
</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="height" type="int" defaultValue="300"/>
<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 SimulatorPathKey(PREFIX ".Simulator");
static const QLatin1String DeviceIdKey(PREFIX ".DeviceId");
static const QLatin1String LastDeployedKey(PREFIX ".LastDeployed");
static const QLatin1String DebuggingHelpersLastDeployedKey(PREFIX ".DebuggingHelpersLastDeployed");
static const QLatin1String LastDeployedHostsKey(PREFIX ".LastDeployedHosts");
static const QLatin1String LastDeployedFilesKey(PREFIX ".LastDeployedFiles");
static const QLatin1String LastDeployedRemotePathsKey(PREFIX ".LastDeployedRemotePaths");
static const QLatin1String LastDeployedTimesKey(PREFIX ".LastDeployedTimes");
static const QLatin1String ProFileKey(".ProFile");
} // namespace Internal

View File

@@ -112,12 +112,12 @@ bool MaemoPackageContents::buildModel() const
}
if (elem == TargetVar) {
m_deployables.prepend(Deployable(m_packageStep->localExecutableFilePath(),
m_deployables.prepend(MaemoDeployable(m_packageStep->localExecutableFilePath(),
paths.first()));
targetFound = true;
} else {
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
? QLatin1String("/usr/local/lib")
: QLatin1String("/usr/local/bin");
m_deployables.prepend(Deployable(m_packageStep->localExecutableFilePath(),
m_deployables.prepend(MaemoDeployable(m_packageStep->localExecutableFilePath(),
remoteDir));
QString errorString;
if (!readProFileContents(&errorString)) {
@@ -144,13 +144,13 @@ bool MaemoPackageContents::buildModel() const
return true;
}
MaemoPackageContents::Deployable MaemoPackageContents::deployableAt(int row) const
MaemoDeployable MaemoPackageContents::deployableAt(int row) const
{
Q_ASSERT(row >= 0 && row < rowCount());
return m_deployables.at(row);
}
bool MaemoPackageContents::addDeployable(const Deployable &deployable,
bool MaemoPackageContents::addDeployable(const MaemoDeployable &deployable,
QString *error)
{
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());
const Deployable &deployable = deployableAt(row);
const MaemoDeployable &deployable = deployableAt(row);
const QString elemToRemove = findInstallsElem(deployable);
if (elemToRemove.isEmpty()) {
*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())
return QVariant();
const Deployable &d = deployableAt(index.row());
const MaemoDeployable &d = deployableAt(index.row());
if (index.column() == 0 && role == Qt::DisplayRole)
return d.localFilePath;
if (role == Qt::DisplayRole || role == Qt::EditRole)
@@ -260,7 +260,7 @@ bool MaemoPackageContents::setData(const QModelIndex &index,
return false;
}
Deployable &deployable = m_deployables[index.row()];
MaemoDeployable &deployable = m_deployables[index.row()];
const QString elemToChange = findInstallsElem(deployable);
if (elemToChange.isEmpty()) {
qWarning("Error: Inconsistent model. "
@@ -353,7 +353,7 @@ QString MaemoPackageContents::cleanPath(const QString &relFileName) const
+ 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);
foreach (const QString &elem, elems) {

View File

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

View File

@@ -66,7 +66,6 @@ MaemoPackageCreationWidget::MaemoPackageCreationWidget(MaemoPackageCreationStep
m_ui->setupUi(this);
m_ui->packageContentsView->setWordWrap(false);
m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
m_ui->packageContentsView->setEnabled(m_step->isPackagingEnabled());
m_ui->packageContentsView->setModel(step->packageContents());
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
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?
if (localFile.isEmpty())
return;
const MaemoPackageContents::Deployable
const MaemoDeployable
deployable(QDir::toNativeSeparators(QFileInfo(localFile).absoluteFilePath()),
"/");
MaemoPackageContents * const contents = m_step->packageContents();
@@ -148,7 +147,6 @@ void MaemoPackageCreationWidget::enableOrDisableRemoveButton()
void MaemoPackageCreationWidget::handleSkipButtonToggled(bool checked)
{
m_step->setPackagingEnabled(!checked);
m_ui->packageContentsView->setEnabled(m_step->isPackagingEnabled());
}
} // namespace Internal

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -105,10 +105,6 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
connect(project, SIGNAL(buildDirectoryInitialized()),
this, SLOT(updateImportLabel()));
QtVersionManager *vm = QtVersionManager::instance();
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
this, SLOT(qtVersionsChanged()));
}
Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget()
@@ -196,6 +192,9 @@ void Qt4ProjectConfigWidget::init(ProjectExplorer::BuildConfiguration *bc)
m_ui->nameLineEdit->setText(m_buildConfiguration->displayName());
qtVersionsChanged();
QtVersionManager *vm = QtVersionManager::instance();
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
this, SLOT(qtVersionsChanged()));
bool shadowBuild = m_buildConfiguration->shadowBuild();
m_ui->shadowBuildCheckBox->setChecked(shadowBuild);
@@ -215,6 +214,11 @@ void Qt4ProjectConfigWidget::qtVersionChanged()
if (m_ignoreChange)
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();
updateImportLabel();
updateToolChainCombo();
@@ -228,9 +232,6 @@ void Qt4ProjectConfigWidget::configNameEdited(const QString &newName)
void Qt4ProjectConfigWidget::qtVersionsChanged()
{
if (!m_buildConfiguration) // not yet initialized
return;
m_ignoreChange = true;
QtVersionManager *vm = QtVersionManager::instance();
@@ -396,7 +397,6 @@ void Qt4ProjectConfigWidget::importLabelClicked()
// So we got all the information now apply it...
m_buildConfiguration->setQtVersion(version);
// Combo box will be updated at the end
QMakeStep *qmakeStep = m_buildConfiguration->qmakeStep();
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.gestures 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())
importCode += QString("import %0 1.0;\n").arg(pluginImportName).toAscii();

View File

@@ -803,10 +803,10 @@ void TestCore::testRewriterImports()
QVERIFY(!import.hasVersion());
QVERIFY(!import.hasAlias());
// import org.webkit 1.0 as Web
// import QtWebKit 1.0 as Web
import = model->imports().at(2);
QVERIFY(import.isLibraryImport());
QCOMPARE(import.url(), QString("org.webkit"));
QCOMPARE(import.url(), QString("QtWebKit"));
QVERIFY(import.hasVersion());
QCOMPARE(import.version(), QString("1.0"));
QVERIFY(import.hasAlias());
@@ -835,12 +835,12 @@ void TestCore::testRewriterChangeImports()
//
// 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);
const QLatin1String qmlWithImport("\n"
"import Qt 4.7\n"
"import org.webkit 1.0\n"
"import QtWebKit 1.0\n"
"\n"
"Rectangle {}\n");
QCOMPARE(textEdit.toPlainText(), qmlWithImport);
@@ -856,12 +856,12 @@ void TestCore::testRewriterChangeImports()
//
// 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);
const QLatin1String qmlWithAliasImport("\n"
"import Qt 4.7\n"
"import org.webkit 1.0 as Web\n"
"import QtWebKit 1.0 as Web\n"
"\n"
"Rectangle {}\n");
QCOMPARE(textEdit.toPlainText(), qmlWithAliasImport);
@@ -880,12 +880,12 @@ void TestCore::testRewriterChangeImports()
textEdit.setPlainText(qmlWithImport);
QCOMPARE(model->imports().size(), 2);
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);
QCOMPARE(model->imports().size(), 2);
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);
QCOMPARE(model->imports().size(), 1);
@@ -3709,7 +3709,7 @@ void TestCore::testMetaInfo()
QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item", 4, 7));
// 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
QVERIFY(model->metaInfo().hasNodeMetaInfo("QGraphicsObject", 4, 7)); // Qt 4.7 namespace

View File

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

View File

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