r20316 by jghali - fix drag and drop issue on main window on Windows

scribus-commit scribus-commit at lists.scribus.net
Wed Aug 12 22:25:32 UTC 2015


Author: jghali
Date: Wed Aug 12 22:25:32 2015
New Revision: 20316

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20316
Log:
fix drag and drop issue on main window on Windows

Modified:
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20316&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed Aug 12 22:25:32 2015
@@ -8621,18 +8621,18 @@
 void ScribusMainWindow::dropEvent ( QDropEvent * e)
 {
 	bool accepted = false;
-	if ( e->mimeData()->hasFormat("text/uri-list"))
+	if (e->mimeData()->hasFormat("text/uri-list"))
 	{
 		QString fileUrl;
 		QList<QUrl> fileUrls = e->mimeData()->urls();
-		for( int i = 0; i < fileUrls.count(); ++i )
+		for (int i = 0; i < fileUrls.count(); ++i)
 		{
 			fileUrl = fileUrls[i].toLocalFile().toLower();
-			if ( fileUrl.endsWith(".sla") || fileUrl.endsWith(".sla.gz") )
+			if (fileUrl.endsWith(".sla") || fileUrl.endsWith(".sla.gz"))
 			{
 				QUrl url( fileUrls[i] );
-				QFileInfo fi(url.path());
-				if ( fi.exists() )
+				QFileInfo fi(url.toLocalFile());
+				if (fi.exists())
 				{
 					accepted = true;
 					loadDoc( fi.absoluteFilePath() );
@@ -8641,8 +8641,8 @@
 			else if (fileUrl.endsWith(".sce"))
 			{
 				QUrl url( fileUrls[i] );
-				QFileInfo fi(url.path());
-				if ( fi.exists() )
+				QFileInfo fi(url.toLocalFile());
+				if (fi.exists())
 				{
 					accepted = true;
 					QString data;
@@ -8651,7 +8651,7 @@
 					data = QString::fromUtf8(cf.data());
 					double gx, gy, gw, gh;
 					ScriXmlDoc ss;
-					if(ss.ReadElemHeader(data, false, &gx, &gy, &gw, &gh))
+					if (ss.ReadElemHeader(data, false, &gx, &gy, &gw, &gh))
 					{
 						doFileNew(gw, gh, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
 						HaveNewDoc();
@@ -8665,13 +8665,13 @@
 			else
 			{
 				QUrl url( fileUrls[i] );
-				FileLoader *fileLoader = new FileLoader(url.path());
+				FileLoader *fileLoader = new FileLoader(url.toLocalFile());
 				int testResult = fileLoader->testFile();
 				delete fileLoader;
 				if ((testResult != -1) && (testResult >= FORMATID_FIRSTUSER))
 				{
-					QFileInfo fi(url.path());
-					if ( fi.exists() )
+					QFileInfo fi(url.toLocalFile());
+					if (fi.exists())
 					{
 						accepted = true;
 						loadDoc( fi.absoluteFilePath() );
@@ -8689,7 +8689,7 @@
 			{
 				double gx, gy, gw, gh;
 				ScriXmlDoc ss;
-				if(ss.ReadElemHeader(text, false, &gx, &gy, &gw, &gh))
+				if (ss.ReadElemHeader(text, false, &gx, &gy, &gw, &gh))
 				{
 					doFileNew(gw, gh, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
 					HaveNewDoc();




More information about the scribus-commit mailing list