r16169 by fschmid - The extension list for the Filedialog when loading Vector files is now alphabetically sorted.

scribus-commit scribus-commit at lists.scribus.net
Mon Dec 27 12:38:56 CET 2010


Author: fschmid
Date: Mon Dec 27 11:38:56 2010
New Revision: 16169

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16169
Log:
The extension list for the Filedialog when loading Vector files is now alphabetically sorted.

Modified:
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/paintmanager.cpp

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16169&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Mon Dec 27 11:38:56 2010
@@ -1259,14 +1259,14 @@
 {
 	QString fileName;
 	QString allFormats = tr("All Supported Formats")+" (";
-	QString formats = "";
+	QStringList formats;
 	int fmtCode = FORMATID_ODGIMPORT;
 	const FileFormat *fmt = LoadSavePlugin::getFormatById(fmtCode);
 	while (fmt != 0)
 	{
 		if (fmt->load)
 		{
-			formats += fmt->filter + ";;";
+			formats.append(fmt->filter);
 			int an = fmt->filter.indexOf("(");
 			int en = fmt->filter.indexOf(")");
 			while (an != -1)
@@ -1281,9 +1281,10 @@
 	}
 	allFormats += "*.sce *.SCE ";
 	allFormats += "*.shape *.SHAPE);;";
-	formats += "Scribus Objects (*.sce *.SCE);;";
-	formats += "Dia Shapes (*.shape *.SHAPE)";
-	allFormats += formats;
+	formats.append("Scribus Objects (*.sce *.SCE)");
+	formats.append("Dia Shapes (*.shape *.SHAPE)");
+	qSort(formats);
+	allFormats += formats.join(";;");
 	PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
 	QString wdir = dirs->get("pastefile", ".");
 	FPoint pastePoint = m_mouseCurrentPoint;

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16169&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Mon Dec 27 11:38:56 2010
@@ -3411,7 +3411,7 @@
 void ScribusMainWindow::importVectorFile()
 {
 	QString fileName = "";
-	QString formats = "";
+	QStringList formats;
 	QString allFormats = tr("All Supported Formats")+" (";
 	int fmtCode = FORMATID_ODGIMPORT;
 	const FileFormat *fmt = LoadSavePlugin::getFormatById(fmtCode);
@@ -3419,8 +3419,7 @@
 	{
 		if (fmt->load)
 		{
-			qDebug() << "Format " << fmt->filter << " Nr " << fmtCode;
-			formats += fmt->filter + ";;";
+			formats.append(fmt->filter);
 			int an = fmt->filter.indexOf("(");
 			int en = fmt->filter.indexOf(")");
 			while (an != -1)
@@ -3435,9 +3434,10 @@
 	}
 	allFormats += "*.sce *.SCE ";
 	allFormats += "*.shape *.SHAPE);;";
-	formats += "Scribus Objects (*.sce *.SCE);;";
-	formats += "Dia Shapes (*.shape *.SHAPE)";
-	allFormats += formats;
+	formats.append("Scribus Objects (*.sce *.SCE)");
+	formats.append("Dia Shapes (*.shape *.SHAPE)");
+	qSort(formats);
+	allFormats += formats.join(";;");
 	PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
 	QString wdir = dirs->get("pastefile", ".");
 	CustomFDialog dia(this, wdir, tr("Open"), allFormats, fdExistingFiles);

Modified: trunk/Scribus/scribus/ui/paintmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16169&path=/trunk/Scribus/scribus/ui/paintmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.cpp (original)
+++ trunk/Scribus/scribus/ui/paintmanager.cpp Mon Dec 27 11:38:56 2010
@@ -1056,7 +1056,7 @@
 		else if ((it->parent() == patternItems) || (it == patternItems))
 		{
 			QString fileName;
-			QString formats = "";
+			QStringList formats;
 			QString allFormats = tr("All Supported Formats")+" (";
 			int fmtCode = FORMATID_ODGIMPORT;
 			const FileFormat *fmt = LoadSavePlugin::getFormatById(fmtCode);
@@ -1064,7 +1064,7 @@
 			{
 				if (fmt->load)
 				{
-					formats += fmt->filter + ";;";
+					formats.append(fmt->filter);
 					int an = fmt->filter.indexOf("(");
 					int en = fmt->filter.indexOf(")");
 					while (an != -1)
@@ -1078,9 +1078,9 @@
 				fmt = LoadSavePlugin::getFormatById(fmtCode);
 			}
 			allFormats += "*.sce *.SCE ";
-			allFormats += "*.shape *.SHAPE);;";
-			formats += "Scribus Objects (*.sce *.SCE);;";
-			formats += "Dia Shapes (*.shape *.SHAPE)";
+			allFormats += "*.shape *.SHAPE ";
+			formats.append("Scribus Objects (*.sce *.SCE)");
+			formats.append("Dia Shapes (*.shape *.SHAPE)");
 			QString form1 = "";
 			QString form2 = "";
 			QStringList imgFormats;
@@ -1092,7 +1092,7 @@
 				form2 = QString(QImageReader::supportedImageFormats().at(i)).toUpper();
 				if ((form1 == "png") || (form1 == "xpm") || (form1 == "gif"))
 				{
-					formats += form2 + " (*."+form1+" *."+form2+");;";
+					formats.append(form2 + " (*."+form1+" *."+form2+")");
 					allFormats += "*."+form1+" *."+form2+" ";
 					imgFormats.append(form1);
 				}
@@ -1102,7 +1102,7 @@
 					// are acceptable extensions.
 					if (!jpgFound)
 					{
-						formats += "JPEG (*.jpg *.jpeg *.JPG *.JPEG);;";
+						formats.append("JPEG (*.jpg *.jpeg *.JPG *.JPEG)");
 						allFormats += "*.jpg *.jpeg *.JPG *.JPEG ";
 						imgFormats.append("jpeg");
 						imgFormats.append("jpg");
@@ -1113,7 +1113,7 @@
 				{
 					if (!tiffFound)
 					{
-						formats += "TIFF (*.tif *.tiff *.TIF *.TIFF);;";
+						formats.append("TIFF (*.tif *.tiff *.TIF *.TIFF)");
 						allFormats += "*.tif *.tiff *.TIF *.TIFF ";
 						imgFormats.append("tif");
 						imgFormats.append("tiff");
@@ -1128,17 +1128,16 @@
 			}
 			if (!tiffFound)
 			{
-				formats += "TIFF (*.tif *.tiff *.TIF *.TIFF);;";
+				formats.append("TIFF (*.tif *.tiff *.TIF *.TIFF)");
 				allFormats += "*.tif *.tiff *.TIF *.TIFF ";
 			}
 			if (!jpgFound)
 			{
-				formats += "JPEG (*.jpg *.jpeg *.JPG *.JPEG);;";
+				formats.append("JPEG (*.jpg *.jpeg *.JPG *.JPEG)");
 				allFormats += "*.jpg *.jpeg *.JPG *.JPEG ";
 			}
-			formats += "PSD (*.psd *.PSD);;";
-			formats += "Gimp Patterns (*.pat *.PAT);;";
-			formats += tr("All Files (*)");
+			formats.append("PSD (*.psd *.PSD)");
+			formats.append("Gimp Patterns (*.pat *.PAT)");
 			allFormats += "*.psd *.PSD ";
 			allFormats += "*.pat *.PAT);;";
 			imgFormats.append("tif");
@@ -1149,7 +1148,8 @@
 			imgFormats.append("eps");
 			imgFormats.append("epsi");
 			imgFormats.append("ps");
-			allFormats += formats;
+			qSort(formats);
+			allFormats += formats.join(";;");
 			PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
 			QString wdir = dirs->get("patterns", ".");
 			CustomFDialog dia(this, wdir, tr("Open"), allFormats, fdHidePreviewCheckBox | fdExistingFiles);




More information about the scribus-commit mailing list