r17525 by craig - Add downloads and user dictionary paths to ScPath

scribus-commit scribus-commit at lists.scribus.net
Tue May 29 20:36:52 UTC 2012


Author: craig
Date: Tue May 29 20:36:52 2012
New Revision: 17525

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17525
Log:
Add downloads and user dictionary paths to ScPath

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

Modified: trunk/Scribus/scribus/scpaths.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17525&path=/trunk/Scribus/scribus/scpaths.cpp
==============================================================================
--- trunk/Scribus/scribus/scpaths.cpp (original)
+++ trunk/Scribus/scribus/scpaths.cpp Tue May 29 20:36:52 2012
@@ -235,6 +235,7 @@
 	QString windowsLOPath("LibreOffice 3.5/share/extensions");
 	QDir d;
 	QStringList spellDirs;
+	spellDirs.append(getUserDictDir(false));
 	spellDirs.append(m_shareDir + "dicts/spelling/");
 #ifdef Q_OS_MAC
 	d.setPath(macPortsPath);
@@ -423,6 +424,17 @@
 	return getApplicationDataDir() + "plugins/";
 }
 
+QString ScPaths::getUserDictDir(bool createIfNotExists)
+{
+	QDir userDictDirectory(getApplicationDataDir() + "dicts/");
+	if(createIfNotExists)
+	{
+		if (!userDictDirectory.exists())
+			userDictDirectory.mkpath(userDictDirectory.absolutePath());
+	}
+	return userDictDirectory.absolutePath()+"/";
+}
+
 QString ScPaths::getUserDocumentDir(void)
 {
 #if defined(_WIN32)
@@ -453,6 +465,14 @@
 	return getApplicationDataDir();
 }
 
+QString ScPaths::downloadDir()
+{
+	QDir downloadDirectory(getApplicationDataDir() + "downloads/");
+	if (!downloadDirectory.exists())
+		downloadDirectory.mkpath(downloadDirectory.absolutePath());
+	return downloadDirectory.absolutePath()+"/";
+}
+
 QString ScPaths::getSpecialDir(int folder)
 {
 	QString qstr;

Modified: trunk/Scribus/scribus/scpaths.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17525&path=/trunk/Scribus/scribus/scpaths.h
==============================================================================
--- trunk/Scribus/scribus/scpaths.h (original)
+++ trunk/Scribus/scribus/scpaths.h Tue May 29 20:36:52 2012
@@ -66,6 +66,8 @@
 	static QStringList getDirsFromEnvVar(const QString envVar, const QString dirToFind);
 	/** @brief Return path to application data dir*/
 	static QString getApplicationDataDir(void);
+	/** @brief Return path to application data dir for downloaded dictsionaries*/
+	static QString getUserDictDir(bool createIfNotExists);
 	/** @brief Return path to image cache dir*/
 	static QString getImageCacheDir(void);
 	/** @brief Return path to plugin data dir*/
@@ -74,6 +76,8 @@
 	static QString getUserDocumentDir(void);
 	/** @brief Return path to directory used for temporary files*/
 	static QString getTempFileDir(void);
+	/** @brief Return path to directory used for downloaded (permanent) files*/
+	static QString downloadDir(void);
 	/** @brief Return path to Contents OSX subdirectory*/
 	QString bundleDir(void) const;
 




More information about the scribus-commit mailing list