r20513 by craig -

scribus-commit scribus-commit at lists.scribus.net
Mon Nov 2 09:59:31 UTC 2015


Author: craig
Date: Mon Nov  2 09:59:31 2015
New Revision: 20513

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20513
Log:
#13413: Incorrect error message <JurajF>

Modified:
    trunk/Scribus/scribus/scribusapp.cpp
    trunk/Scribus/scribus/scribusapp.h

Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20513&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp	(original)
+++ trunk/Scribus/scribus/scribusapp.cpp	Mon Nov  2 09:59:31 2015
@@ -235,7 +235,7 @@
 			}
 			prefsUserFile = QFile::decodeName(args[argi + 1].toLocal8Bit());
 			if (!QFileInfo(prefsUserFile).exists()) {
-				showError(prefsUserFile);
+				std::cout << tr("Preferenes file %1 does not exist, aborting.").arg(prefsUserFile).toLocal8Bit().data() << std::endl;
 				std::exit(EXIT_FAILURE);
 			} else {
 				++argi;
@@ -250,7 +250,7 @@
 			}
 			pythonScript = QFile::decodeName(args[argi + 1].toLocal8Bit());
 			if (!QFileInfo(pythonScript).exists()) {
-				showError(pythonScript);
+				std::cout << tr("Python script %1 does not exist, aborting.").arg(pythonScript).toLocal8Bit().data() << std::endl;
 				std::exit(EXIT_FAILURE);
 			} else {
 				++argi;
@@ -259,6 +259,10 @@
 			argi++;
 			break;
 		} else { //argument is not a known option, but either positional parameter or invalid.
+			if (arg.left(1) == "-") {
+				std::cout << tr("Invalid argument: %1").arg(arg).toLocal8Bit().data() << std::endl;
+				std::exit(EXIT_FAILURE);
+			}
 			break;
 		}
 	}
@@ -266,7 +270,7 @@
 	for ( ; argi<argsc; argi++) {
 		fileName = QFile::decodeName(args[argi].toLocal8Bit());
 		if (!QFileInfo(fileName).exists()) {
-			showError(fileName);
+			std::cout << tr("File %1 does not exist, aborting.").arg(fileName).toLocal8Bit().data() << std::endl;
 			std::exit(EXIT_FAILURE);
 		} else {
 			filesToLoad.append(fileName);
@@ -598,18 +602,6 @@
 	endl(ts);
 }
 
-void ScribusQApp::showError(QString arg)
-{
-	showHeader();
-	if (arg.left(1) == "-" || arg.left(2) == "--") {
-		std::cout << tr("Invalid argument: %1").arg(arg).toLocal8Bit().data() << std::endl;
-	} else {
-		std::cout << tr("File %1 does not exist, aborting.").arg(arg).toLocal8Bit().data() << std::endl;
-	}
-	showUsage();
-	std::cout << tr("Scribus Version").toLocal8Bit().data() << " " << VERSION << std::endl;
-}
-
 void ScribusQApp::neverSplash(bool splashOff)
 {
 	QString prefsDir = ScPaths::getApplicationDataDir();

Modified: trunk/Scribus/scribus/scribusapp.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20513&path=/trunk/Scribus/scribus/scribusapp.h
==============================================================================
--- trunk/Scribus/scribus/scribusapp.h	(original)
+++ trunk/Scribus/scribus/scribusapp.h	Mon Nov  2 09:59:31 2015
@@ -77,7 +77,6 @@
 	private:
 		ScribusCore* m_ScCore;
 		void showHeader();
-		void showError(QString arg);
 		void showVersion();
 		/*!
 		\author Franz Schmid




More information about the scribus-commit mailing list