forked from qt-creator/qt-creator
Maemo: Fix Harmattan icon workaround.
Don't hardcode PNG format.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user