diff options
author | Christian Kandeler <christian.kandeler@nokia.com> | 2011-04-28 15:11:42 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@nokia.com> | 2011-04-29 09:45:35 +0200 |
commit | 12b2a5fff0df1f20b117d3ad9ba4782ee944ccac (patch) | |
tree | 282fe5dcd4018e2c49e38b39107fea4cbb597cd4 /src/plugins/qt4projectmanager/qt-maemo | |
parent | 52f43920d845a665dc0fe9afb26f4d2c586d45b8 (diff) | |
download | qt-creator-12b2a5fff0df1f20b117d3ad9ba4782ee944ccac.tar.gz |
Maemo: Harmattan application icons are now 80x80 pixels big.
Task-number: https://projects.maemo.org/bugzilla/show_bug.cgi?id=250237
Diffstat (limited to 'src/plugins/qt4projectmanager/qt-maemo')
5 files changed, 22 insertions, 9 deletions
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp index 1eafceacd2..f3d6b3a4a4 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp @@ -52,9 +52,6 @@ namespace Qt4ProjectManager { namespace Internal { -namespace { -const QLatin1String RemoteIconPath("/usr/share/icons/hicolor/64x64/apps"); -} // anonymous namespace MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode, ProFileUpdateSetting updateSetting, QObject *parent) @@ -269,7 +266,7 @@ bool MaemoDeployableListModel::addIcon(const QString &fileName) return true; const QString filesLine = QLatin1String("icon.files = ") + fileName; - const QString pathLine = QLatin1String("icon.path = ") + RemoteIconPath; + const QString pathLine = QLatin1String("icon.path = ") + remoteIconDir(); const QLatin1String installsLine("INSTALLS += icon"); if (!addLinesToProFile(QStringList() << filesLine << pathLine << installsLine)) @@ -278,7 +275,7 @@ bool MaemoDeployableListModel::addIcon(const QString &fileName) beginInsertRows(QModelIndex(), rowCount(), rowCount()); const QString filePath = QFileInfo(m_proFilePath).path() + QLatin1Char('/') + fileName; - m_deployables << MaemoDeployable(filePath, RemoteIconPath); + m_deployables << MaemoDeployable(filePath, remoteIconDir()); endInsertRows(); return true; } @@ -291,7 +288,7 @@ QString MaemoDeployableListModel::remoteIconFilePath() const foreach (const MaemoDeployable &d, m_deployables) { const QByteArray extension = QFileInfo(d.localFilePath).suffix().toLocal8Bit(); - if (d.remoteDir.startsWith(RemoteIconPath) + if (d.remoteDir.startsWith(remoteIconDir()) && imageTypes.contains(extension)) return d.remoteDir + QLatin1Char('/') + QFileInfo(d.localFilePath).fileName(); @@ -339,5 +336,13 @@ QString MaemoDeployableListModel::installPrefix() const return QLatin1String("/opt/") + m_projectName; } +QString MaemoDeployableListModel::remoteIconDir() const +{ + const QtVersion *const qv = qtVersion(); + QTC_ASSERT(qv, return QString()); + return QString::fromLocal8Bit("/usr/share/icons/hicolor/%1x%1/apps") + .arg(MaemoGlobal::applicationIconSize(MaemoGlobal::version(qv))); +} + } // namespace Qt4ProjectManager } // namespace Internal diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h index cf9b07783a..88b4ee2dbc 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h @@ -64,6 +64,7 @@ public: MaemoDeployable deployableAt(int row) const; bool isModified() const { return m_modified; } void setUnModified() { m_modified = false; } + const QtVersion *qtVersion() const; QString localExecutableFilePath() const; QString remoteExecutableFilePath() const; QString projectName() const { return m_projectName; } @@ -97,9 +98,9 @@ private: bool isEditable(const QModelIndex &index) const; bool buildModel(); bool addLinesToProFile(const QStringList &lines); - const QtVersion *qtVersion() const; QString proFileScope() const; QString installPrefix() const; + QString remoteIconDir() const; const Qt4ProjectType m_projectType; const QString m_proFilePath; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployconfigurationwidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeployconfigurationwidget.cpp index ff5af3dc4e..c84ffe4c02 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployconfigurationwidget.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployconfigurationwidget.cpp @@ -133,8 +133,9 @@ void MaemoDeployConfigurationWidget::addIcon() MaemoDeployableListModel *const model = m_deployConfig->deployables()->modelAt(modelRow); + const int iconDim = MaemoGlobal::applicationIconSize(MaemoGlobal::version(model->qtVersion())); const QString origFilePath = QFileDialog::getOpenFileName(this, - tr("Choose Icon (will be scaled to 64x64 pixels, if necessary)"), + tr("Choose Icon (will be scaled to %1x%1 pixels, if necessary)").arg(iconDim), model->projectDir(), QLatin1String("(*.png)")); if (origFilePath.isEmpty()) return; @@ -144,7 +145,7 @@ void MaemoDeployConfigurationWidget::addIcon() tr("Unable to read image")); return; } - const QSize iconSize(64, 64); + const QSize iconSize(iconDim, iconDim); if (pixmap.size() != iconSize) pixmap = pixmap.scaled(iconSize); const QString newFileName = model->projectName() + QLatin1Char('.') diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp index c21c242f5e..315083dcb0 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp @@ -127,6 +127,11 @@ QString MaemoGlobal::devrootshPath() return QLatin1String("/usr/lib/mad-developer/devrootsh"); } +int MaemoGlobal::applicationIconSize(MaemoDeviceConfig::OsVersion osVersion) +{ + return osVersion == MaemoDeviceConfig::Maemo6 ? 80 : 64; +} + QString MaemoGlobal::remoteSudo(MaemoDeviceConfig::OsVersion osVersion, const QString &uname) { diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h index 65ee14a539..9a6925e597 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h @@ -83,6 +83,7 @@ public: static QString homeDirOnDevice(const QString &uname); static QString devrootshPath(); + static int applicationIconSize(MaemoDeviceConfig::OsVersion osVersion); static QString remoteSudo(MaemoDeviceConfig::OsVersion, const QString &uname); static QString remoteCommandPrefix(MaemoDeviceConfig::OsVersion osVersion, |