Maemo: Fix Harmattan icon workaround.

Don't hardcode PNG format.
This commit is contained in:
Christian Kandeler
2010-11-26 10:37:32 +01:00
parent 218978a74a
commit f8979403ce
4 changed files with 32 additions and 26 deletions

View File

@@ -236,21 +236,6 @@ bool MaemoDeployableListModel::hasDesktopFile() const
return false;
}
bool MaemoDeployableListModel::canAddIcon() const
{
if (m_projectType == LibraryTemplate)
return false;
const QList<QByteArray> &imageTypes = QImageReader::supportedImageFormats();
foreach (const MaemoDeployable &d, m_deployables) {
const QByteArray extension
= QFileInfo(d.localFilePath).suffix().toLocal8Bit();
if (d.remoteDir.startsWith(RemoteIconPath)
&& imageTypes.contains(extension))
return false;
}
return true;
}
bool MaemoDeployableListModel::addDesktopFile(QString &error)
{
if (!canAddDesktopFile())
@@ -324,6 +309,22 @@ bool MaemoDeployableListModel::addIcon(const QString &fileName, QString &error)
return true;
}
QString MaemoDeployableListModel::remoteIconFilePath() const
{
if (m_projectType == LibraryTemplate)
return QString();
const QList<QByteArray> &imageTypes = QImageReader::supportedImageFormats();
foreach (const MaemoDeployable &d, m_deployables) {
const QByteArray extension
= QFileInfo(d.localFilePath).suffix().toLocal8Bit();
if (d.remoteDir.startsWith(RemoteIconPath)
&& imageTypes.contains(extension))
return d.remoteDir + QLatin1Char('/')
+ QFileInfo(d.localFilePath).fileName();
}
return QString();
}
bool MaemoDeployableListModel::addLinesToProFile(const QStringList &lines)
{
QFile projectFile(m_proFilePath);