[Uml-devel] branches/work/soc-umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Fri Apr 22 17:53:59 UTC 2011
SVN commit 1228855 by fischer:
Krazy issue about improperly initialized global static objects fixed.
M +14 -14 umlviewimageexportermodel.cpp
M +4 -1 umlviewimageexportermodel.h
--- branches/work/soc-umbrello/umbrello/umlviewimageexportermodel.cpp #1228854:1228855
@@ -39,8 +39,8 @@
// system includes
#include <cmath>
-static QStringList supportedImageTypesList;
-static QStringList supportedMimeTypesList;
+QStringList UMLViewImageExporterModel::s_supportedImageTypesList;
+QStringList UMLViewImageExporterModel::s_supportedMimeTypesList;
/**
* Returns a QStringList containing all the supported image types to use when exporting.
@@ -50,23 +50,23 @@
*/
QStringList UMLViewImageExporterModel::supportedImageTypes()
{
- if (!supportedImageTypesList.size()) {
+ if (!s_supportedImageTypesList.size()) {
// QT supported formats
QList<QByteArray> qImageFormats = QImageWriter::supportedImageFormats();
Q_FOREACH(const QByteArray& it, qImageFormats) {
const QString format = it.toLower();
- if (!supportedImageTypesList.contains(format))
- supportedImageTypesList << format;
+ if (!s_supportedImageTypesList.contains(format))
+ s_supportedImageTypesList << format;
}
// specific supported formats
- if (!supportedImageTypesList.contains("eps"))
- supportedImageTypesList << "eps";
- if (!supportedImageTypesList.contains("svg"))
- supportedImageTypesList << "svg";
+ if (!s_supportedImageTypesList.contains("eps"))
+ s_supportedImageTypesList << "eps";
+ if (!s_supportedImageTypesList.contains("svg"))
+ s_supportedImageTypesList << "svg";
}
- supportedImageTypesList.sort();
+ s_supportedImageTypesList.sort();
- return supportedImageTypesList;
+ return s_supportedImageTypesList;
}
/**
@@ -77,16 +77,16 @@
*/
QStringList UMLViewImageExporterModel::supportedMimeTypes()
{
- if (!supportedMimeTypesList.size()) {
+ if (!s_supportedMimeTypesList.size()) {
const QStringList imageTypes = UMLViewImageExporterModel::supportedImageTypes();
for (QStringList::ConstIterator it = imageTypes.begin(); it != imageTypes.end(); ++it) {
QString mimeType = imageTypeToMimeType(*it);
if (!mimeType.isNull())
- supportedMimeTypesList.append(mimeType);
+ s_supportedMimeTypesList.append(mimeType);
}
}
- return supportedMimeTypesList;
+ return s_supportedMimeTypesList;
}
/**
--- branches/work/soc-umbrello/umbrello/umlviewimageexportermodel.h #1228854:1228855
@@ -4,7 +4,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * copyright (C) 2006-2009 *
+ * copyright (C) 2006-2011 *
* Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
***************************************************************************/
@@ -57,6 +57,9 @@
bool fixEPS(const QString &fileName, const QRect& rect) const;
+ static QStringList s_supportedImageTypesList;
+ static QStringList s_supportedMimeTypesList;
+
};
#endif
More information about the umbrello-devel
mailing list