Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 1692 → Rev 1693

/branches/Version13x/Scribus/scribus/hyphenator.cpp
31,6 → 31,7
#include <qdir.h>
#include <cstdlib>
#include <string>
#include "scpaths.h"
#include "scribus.h"
 
/*!
52,7 → 53,7
Automatic = doc->Automatic;
AutoCheck = doc->AutoCheck;
HyCount = doc->HyCount;
QString pfad = LIBDIR;
QString pfad = ScPaths::instance().libDir();
if (Sap->Sprachen.contains(doc->Language))
Language = doc->Language;
else
110,7 → 111,7
char *filename = NULL;
if (hdict != NULL)
hnj_hyphen_free(hdict);
QString pfad = LIBDIR;
QString pfad = ScPaths::instance().libDir();
Language = name;
doc->Language = name;
pfad += "dicts/" + Sap->Sprachen[Language];
/branches/Version13x/Scribus/scribus/util.cpp
36,6 → 36,7
#include "md5.h"
#include <setjmp.h>
#include "qprocess.h"
#include "scpaths.h"
 
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
2501,7 → 2502,7
 
QPixmap loadIcon(QString nam)
{
QString iconFilePath = QString("%1/%2").arg(ICONDIR).arg(nam);
QString iconFilePath = QString("%1/%2").arg(ScPaths::instance().iconDir()).arg(nam);
QPixmap pm;
if (!QFile::exists(iconFilePath))
qWarning("Unable to load icon %s: File not found", iconFilePath.ascii());
/branches/Version13x/Scribus/scribus/Makefile.am
8,7 → 8,7
pixbuf_libs = pixbuf/libpixbuf.la
endif
 
scribus_SOURCES = about.cpp art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c scrpalettebase.cpp docitemattrprefs.ui pageitemattributes.ui tocindexprefs.ui pagesize.cpp pluginmanager.cpp prefs.cpp fontreplacedialog.cpp tabpdfoptions.cpp tabcheckdoc.cpp checkDocument.cpp units.cpp scraction.cpp menumanager.cpp scmenu.cpp charselect.cpp filewatcher.cpp tabtools.cpp tabguides.cpp tabtypography.cpp arrowchooser.cpp polygonwidget.cpp prefsdialogbase.cpp fileloader.cpp gradienteditor.cpp gtgettext.cpp gtdialogs.cpp gtstyle.cpp gtframestyle.cpp gtparagraphstyle.cpp gtfont.cpp gtwriter.cpp gtaction.cpp gtmeasure.cpp undomanager.cpp undostate.cpp undoobject.cpp undogui.cpp prefsfile.cpp prefscontext.cpp prefsreader.cpp prefstable.cpp ioapi.c unzip.c fileunzip.cpp measurements.cpp langmgr.cpp tabruler.cpp insertTable.cpp pageselector.cpp shadebutton.cpp alignselect.cpp styleselect.cpp search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp extimageprops.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scribus.cpp main.cpp
scribus_SOURCES = about.cpp art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c scrpalettebase.cpp docitemattrprefs.ui pageitemattributes.ui tocindexprefs.ui pagesize.cpp pluginmanager.cpp prefs.cpp fontreplacedialog.cpp tabpdfoptions.cpp tabcheckdoc.cpp checkDocument.cpp units.cpp scraction.cpp menumanager.cpp scmenu.cpp charselect.cpp filewatcher.cpp tabtools.cpp tabguides.cpp tabtypography.cpp arrowchooser.cpp polygonwidget.cpp prefsdialogbase.cpp fileloader.cpp gradienteditor.cpp gtgettext.cpp gtdialogs.cpp gtstyle.cpp gtframestyle.cpp gtparagraphstyle.cpp gtfont.cpp gtwriter.cpp gtaction.cpp gtmeasure.cpp undomanager.cpp undostate.cpp undoobject.cpp undogui.cpp prefsfile.cpp prefscontext.cpp prefsreader.cpp prefstable.cpp ioapi.c unzip.c fileunzip.cpp measurements.cpp langmgr.cpp tabruler.cpp insertTable.cpp pageselector.cpp shadebutton.cpp alignselect.cpp styleselect.cpp search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp extimageprops.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scpaths.cpp scribus.cpp main.cpp
 
INTERFACES =
TRANSLATIONS =
15,7 → 15,7
 
SUBDIRS = $(pixbuf_subdirs) dicts doc icons keysets libpdf libpostscript manpages plugins po profiles qm templates
 
EXTRA_DIST = about.cpp about.h main.cpp scribus.cpp scribus.h scribusdoc.cpp scribusdoc.h scribusview.cpp scribusview.h newfile.h newfile.cpp pageitem.cpp pageitem.h hruler.cpp hruler.h vruler.cpp vruler.h colorm.cpp colorm.h query.cpp query.h dcolor.cpp dcolor.h cpalette.cpp cpalette.h mdup.cpp mdup.h docinfo.cpp docinfo.h reformdoc.cpp reformdoc.h serializer.cpp serializer.h align.cpp align.h fmitem.cpp fmitem.h fontprefs.cpp fontprefs.h missing.cpp missing.h tree.cpp tree.h pdfopts.cpp pdfopts.h inspage.cpp inspage.h delpages.cpp delpages.h movepage.cpp movepage.h mspinbox.cpp mspinbox.h helpbrowser.cpp helpbrowser.h icons5.h linkbutton.cpp linkbutton.h icons6.h linecombo.cpp linecombo.h scribusXml.cpp scribusXml.h cmykfw.cpp cmykfw.h cmykcolor.cpp cmykcolor.h util.cpp colorchart.cpp colorchart.h druck.cpp druck.h editformats.cpp editformats.h edit1format.cpp edit1format.h spalette.cpp spalette.h frameedit.cpp frameedit.h scfonts.cpp scfonts.h scrap.cpp scrap.h scfonts_ttf.cpp scfonts_ttf.h muster.cpp muster.h applytemplate.cpp applytemplate.h newtemp.cpp newtemp.h picstatus.cpp picstatus.h picsearch.cpp picsearch.h customfdialog.cpp customfdialog.h cmsprefs.cpp cmsprefs.h bookmwin.cpp bookmwin.h annot.cpp annot.h navigator.cpp navigator.h keymanager.cpp keymanager.h werktoolb.cpp werktoolb.h mpalette.h mpalette.cpp polyprops.cpp polyprops.h layers.cpp layers.h page.cpp page.h editor.cpp editor.h selfield.cpp selfield.h javadocs.cpp javadocs.h buttonicon.cpp buttonicon.h annota.cpp annota.h fpoint.cpp fpoint.h fpointarray.cpp fpointarray.h seiten.cpp seiten.h hysettings.cpp hysettings.h hnjalloc.c hnjalloc.h hyask.cpp hyask.h hyphen.c hyphen.h hyphenator.cpp hyphenator.h scribuswin.cpp scribuswin.h guidemanager.cpp guidemanager.h cupsoptions.cpp cupsoptions.h md5.c md5.h rc4.c rc4.h mergedoc.cpp mergedoc.h bookpalette.cpp bookpalette.h splash.h fontcombo.h scpainter.cpp scpainter.h vgradient.cpp vgradient.h story.cpp story.h autoform.cpp autoform.h fparser.cpp fparser.h tabmanager.cpp tabmanager.h search.cpp search.h styleselect.cpp styleselect.h alignselect.cpp alignselect.h shadebutton.cpp shadebutton.h pageselector.cpp color.h gtaction.cpp gtaction.h gtwriter.cpp gtwriter.h gtfont.cpp gtfont.h gtdialogs.cpp gtdialogs.h gtstyle.cpp gtstyle.h gtframestyle.cpp gtframestyle.h gtparagraphstyle.cpp gtparagraphstyle.h gtmeasure.cpp gtmeasure.h undomanager.cpp undomanager.h undostate.cpp undostate.h undoobject.cpp undoobject.h undogui.cpp undogui.h prefsfile.cpp prefsfile.h prefscontext.cpp prefscontext.h prefsreader.cpp prefsreader.h prefstable.cpp prefstable.h prefs.cpp prefs.h ioapi.c ioapi.h unzip.c unzip.h fileunzip.cpp fileunzip.h langmgr.h langmgr.cpp polygonwidget.cpp polygonwidget.h fileloader.cpp fileloader.h prefsdialogbase.cpp prefsdialogbase.h gradienteditor.cpp gradienteditor.h pageselector.h insertTable.cpp insertTable.h tabtools.cpp tabtools.h tabguides.cpp tabguides.h tabtypography.cpp tabtypography.h tabcheckdoc.cpp tabcheckdoc.h tabpdfoptions.cpp tabpdfoptions.h arrowchooser.cpp arrowchooser.h charselect.cpp charselect.h fontreplacedialog.cpp fontreplacedialog.h filewatcher.cpp filewatcher.h checkDocument.cpp checkDocument.h art_kmisc.c art_kmisc.h art_render_misc.c art_render_misc.h art_render_pattern.c art_render_pattern.h art_rgb.c art_rgb.h art_rgb_affine_private.c art_rgb_affine_private.h art_rgb_svp.c art_rgb_svp.h art_rgba_affine.c art_rgba_affine.h LoremIpsum.txt rgbscribus.txt rgbscribusgreys.txt rgbscribusgnome.txt rgbsvg.txt units.h units.cpp scribusstructs.h scraction.cpp scraction.h menumanager.cpp menumanager.h scmenu.cpp scmenu.h scrpalettebase.cpp scrpalettebase.h docitemattrprefs.ui pageitemattributes.ui tocindexprefs.ui pluginmanager.cpp pluginmanager.h extimageprops.cpp extimageprops.h pagesize.cpp pagesize.h
EXTRA_DIST = about.cpp about.h main.cpp scribus.cpp scribus.h scribusdoc.cpp scribusdoc.h scribusview.cpp scribusview.h newfile.h newfile.cpp pageitem.cpp pageitem.h hruler.cpp hruler.h vruler.cpp vruler.h colorm.cpp colorm.h query.cpp query.h dcolor.cpp dcolor.h cpalette.cpp cpalette.h mdup.cpp mdup.h docinfo.cpp docinfo.h reformdoc.cpp reformdoc.h serializer.cpp serializer.h align.cpp align.h fmitem.cpp fmitem.h fontprefs.cpp fontprefs.h missing.cpp missing.h tree.cpp tree.h pdfopts.cpp pdfopts.h inspage.cpp inspage.h delpages.cpp delpages.h movepage.cpp movepage.h mspinbox.cpp mspinbox.h helpbrowser.cpp helpbrowser.h icons5.h linkbutton.cpp linkbutton.h icons6.h linecombo.cpp linecombo.h scribusXml.cpp scribusXml.h cmykfw.cpp cmykfw.h cmykcolor.cpp cmykcolor.h util.cpp colorchart.cpp colorchart.h druck.cpp druck.h editformats.cpp editformats.h edit1format.cpp edit1format.h spalette.cpp spalette.h frameedit.cpp frameedit.h scfonts.cpp scfonts.h scrap.cpp scrap.h scfonts_ttf.cpp scfonts_ttf.h muster.cpp muster.h applytemplate.cpp applytemplate.h newtemp.cpp newtemp.h picstatus.cpp picstatus.h picsearch.cpp picsearch.h customfdialog.cpp customfdialog.h cmsprefs.cpp cmsprefs.h bookmwin.cpp bookmwin.h annot.cpp annot.h navigator.cpp navigator.h keymanager.cpp keymanager.h werktoolb.cpp werktoolb.h mpalette.h mpalette.cpp polyprops.cpp polyprops.h layers.cpp layers.h page.cpp page.h editor.cpp editor.h selfield.cpp selfield.h javadocs.cpp javadocs.h buttonicon.cpp buttonicon.h annota.cpp annota.h fpoint.cpp fpoint.h fpointarray.cpp fpointarray.h seiten.cpp seiten.h hysettings.cpp hysettings.h hnjalloc.c hnjalloc.h hyask.cpp hyask.h hyphen.c hyphen.h hyphenator.cpp hyphenator.h scribuswin.cpp scribuswin.h guidemanager.cpp guidemanager.h cupsoptions.cpp cupsoptions.h md5.c md5.h rc4.c rc4.h mergedoc.cpp mergedoc.h bookpalette.cpp bookpalette.h splash.h fontcombo.h scpainter.cpp scpainter.h vgradient.cpp vgradient.h story.cpp story.h autoform.cpp autoform.h fparser.cpp fparser.h tabmanager.cpp tabmanager.h search.cpp search.h styleselect.cpp styleselect.h alignselect.cpp alignselect.h shadebutton.cpp shadebutton.h pageselector.cpp color.h gtaction.cpp gtaction.h gtwriter.cpp gtwriter.h gtfont.cpp gtfont.h gtdialogs.cpp gtdialogs.h gtstyle.cpp gtstyle.h gtframestyle.cpp gtframestyle.h gtparagraphstyle.cpp gtparagraphstyle.h gtmeasure.cpp gtmeasure.h undomanager.cpp undomanager.h undostate.cpp undostate.h undoobject.cpp undoobject.h undogui.cpp undogui.h prefsfile.cpp prefsfile.h prefscontext.cpp prefscontext.h prefsreader.cpp prefsreader.h prefstable.cpp prefstable.h prefs.cpp prefs.h ioapi.c ioapi.h unzip.c unzip.h fileunzip.cpp fileunzip.h langmgr.h langmgr.cpp polygonwidget.cpp polygonwidget.h fileloader.cpp fileloader.h prefsdialogbase.cpp prefsdialogbase.h gradienteditor.cpp gradienteditor.h pageselector.h insertTable.cpp insertTable.h tabtools.cpp tabtools.h tabguides.cpp tabguides.h tabtypography.cpp tabtypography.h tabcheckdoc.cpp tabcheckdoc.h tabpdfoptions.cpp tabpdfoptions.h arrowchooser.cpp arrowchooser.h charselect.cpp charselect.h fontreplacedialog.cpp fontreplacedialog.h filewatcher.cpp filewatcher.h checkDocument.cpp checkDocument.h art_kmisc.c art_kmisc.h art_render_misc.c art_render_misc.h art_render_pattern.c art_render_pattern.h art_rgb.c art_rgb.h art_rgb_affine_private.c art_rgb_affine_private.h art_rgb_svp.c art_rgb_svp.h art_rgba_affine.c art_rgba_affine.h LoremIpsum.txt rgbscribus.txt rgbscribusgreys.txt rgbscribusgnome.txt rgbsvg.txt units.h units.cpp scribusstructs.h scraction.cpp scraction.h menumanager.cpp menumanager.h scmenu.cpp scmenu.h scrpalettebase.cpp scrpalettebase.h docitemattrprefs.ui pageitemattributes.ui tocindexprefs.ui pluginmanager.cpp pluginmanager.h extimageprops.cpp extimageprops.h pagesize.cpp pagesize.h scpaths.h
 
install-data-local:
$(mkinstalldirs) $(prefix)/share/scribus/samples/
/branches/Version13x/Scribus/scribus/helpbrowser.cpp
42,6 → 42,8
#include <qsplitter.h>
#include <qmime.h>
 
#include "scpaths.h"
 
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
#include "win-config.h"
194,7 → 196,7
 
if (jumpToFile=="")
{
QString pfad = DOCDIR;
QString pfad = ScPaths::instance().docDir();
toLoad = pfad + language + "/"; //clean this later to handle 5 char locales
if (jumpToSection=="")
{
242,7 → 244,7
toLoad=filename;
else
{
QString pfad = DOCDIR;
QString pfad = ScPaths::instance().docDir();
toLoad = pfad + "en/index.html";
language="en";
fi = QFileInfo(toLoad);
268,7 → 270,7
 
void HelpBrowser::loadMenu()
{
QString pfad = DOCDIR;
QString pfad = ScPaths::instance().docDir();
QString toLoad;
QString pfad2 = pfad + language + "/menu.xml";
QFileInfo fi = QFileInfo(pfad2);
400,7 → 402,7
//scan for installed tutorials
if (haveTutorials)
{
QString path = DOCDIR;
QString path = ScPaths::instance().docDir();
path += language + "/tutorials/";
QDir dir(path, "*", QDir::Name, QDir::Dirs | QDir::NoSymLinks);
 
482,7 → 484,7
return;
if (item->text(1)!=QString::null)
{
QString pfad = DOCDIR;
QString pfad = ScPaths::instance().docDir();
loadHelp(pfad + language + "/" + item->text(1));
}
}
/branches/Version13x/Scribus/scribus/keymanager.cpp
32,6 → 32,7
#include "scribus.h"
#include "prefsfile.h"
#include "prefscontext.h"
#include "scpaths.h"
 
extern bool overwrite(QWidget *parent, QString filename);
extern PrefsFile* prefsFile;
498,7 → 499,7
 
void KeyManager::resetKeySet()
{
QString location=LIBDIR;
QString location=ScPaths::instance().libDir();
QString defaultKeySetFileName=QDir::convertSeparators(location+"keysets/scribus13.ksxml");
importKeySet(defaultKeySetFileName);
}
506,7 → 507,7
QStringList KeyManager::scanForSets()
{
keySetList.clear();
QString location=LIBDIR;
QString location=ScPaths::instance().libDir();
QString keySetLocation=QDir::convertSeparators(location+"keysets/");
QDir keySetsDir(keySetLocation, "*.ksxml", QDir::Name, QDir::Files | QDir::NoSymLinks);
if ((keySetsDir.exists()) && (keySetsDir.count() != 0))
/branches/Version13x/Scribus/scribus/scpaths.h
0,0 → 1,55
#ifndef SCPATHS_H
#define SCPATHS_H
 
#include "qstring.h"
 
class ScPaths
{
public:
/**
* @brief Get a reference to the ScPaths instance
* creating it if necessary.
* @sa ScPaths::destroy()
*/
static const ScPaths& instance();
/**
* @brief Destroy the ScPaths instance, if any.
* @sa ScPaths::instnace()
*/
static void destroy();
 
/** @brief Return path to documentation directory */
const QString& docDir() const;
/** @brief Return path to icons directory*/
const QString& iconDir() const;
/** @brief Return path to lib directory containing translations,
* keysets, etc. */
const QString& libDir() const;
/** @brief Return path to dir containing plugins. */
const QString& pluginDir() const;
/** @brief Return path to dir containing sample Python scripts */
const QString& sampleScriptDir() const;
/** @brief Return path to dir containing "official" Python scripts */
const QString& scriptDir() const;
/** @brief Return path to containing stock templates */
const QString& templateDir() const;
 
protected:
/** @brief Constructor. Use ScPaths::instance() instead. */
ScPaths();
/** @brief Destructor. Use ScPaths::destroy() instead. */
~ScPaths();
 
/** @brief Pointer to existing instance of ScPaths, if any. */
static ScPaths* m_instance;
 
// Members to hold system paths
QString m_docDir;
QString m_iconDir;
QString m_libDir;
QString m_pluginDir;
QString m_sampleScriptDir;
QString m_scriptDir;
QString m_templateDir;
};
#endif
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Version13x/Scribus/scribus/scribusview.cpp
===================================================================
--- Version13x/Scribus/scribus/scribusview.cpp (revision 1692)
+++ Version13x/Scribus/scribus/scribusview.cpp (revision 1693)
@@ -65,6 +65,7 @@
#include "units.h"
#include "extimageprops.h"
#include "pageitemattributes.h"
+#include "scpaths.h"
#ifdef HAVE_TIFF
#include <tiffio.h>
#endif
@@ -7708,7 +7709,7 @@
if (t == QMessageBox::No)
return;
}
- QString pfad = SAMPLESDIR;
+ QString pfad = ScPaths::instance().sampleScriptDir();
QString pfad2;
pfad2 = pfad + "LoremIpsum.txt";
Serializer *ss = new Serializer(pfad2);
Index: Version13x/Scribus/scribus/scribus.cpp
===================================================================
--- Version13x/Scribus/scribus/scribus.cpp (revision 1692)
+++ Version13x/Scribus/scribus/scribus.cpp (revision 1693)
@@ -127,6 +127,7 @@
#include "tree.h"
#include "scrap.h"
#include "pluginmanager.h"
+#include "scpaths.h"
extern QPixmap loadIcon(QString nam);
extern bool overwrite(QWidget *parent, QString filename);
@@ -377,7 +378,7 @@
/** Default colours **/
Prefs.DColors.clear();
- QString pfadC = LIBDIR;
+ QString pfadC = ScPaths::instance().libDir();
QString pfadC2 = pfadC + "rgbscribus.txt";
QFile fiC(pfadC2);
if (!fiC.exists())
@@ -8151,7 +8152,7 @@
const char *error;
typedef PSLib* (*sdem)(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, ColorList DocColors, bool pdf);
sdem demo;
- QString pfad = QString("%1/libs/libpostscript.%3").arg(LIBDIR).arg(PluginManager::platformDllExtension());
+ QString pfad = QString("%1/libs/libpostscript.%3").arg(ScPaths::instance().libDir()).arg(PluginManager::platformDllExtension());
PSDriver = dlopen(pfad, RTLD_LAZY);
if (!PSDriver)
{
@@ -8261,7 +8262,7 @@
void *PDFDriver;
typedef bool (*sdem)(ScribusApp *plug, QString fn, QString nam, int Components, std::vector<int> &pageNs, QMap<int,QPixmap> thumbs, QProgressBar *dia2);
sdem demo;
- QString pfad = QString("%1/libs/libpdf.%3").arg(LIBDIR).arg(PluginManager::platformDllExtension());
+ QString pfad = QString("%1/libs/libpdf.%3").arg(ScPaths::instance().libDir()).arg(PluginManager::platformDllExtension());
PDFDriver = dlopen(pfad, RTLD_NOW);
if (!PDFDriver)
{
@@ -9076,7 +9077,7 @@
MonitorProfiles.clear();
PrinterProfiles.clear();
InputProfiles.clear();
- QString pfad = LIBDIR;
+ QString pfad = ScPaths::instance().libDir();
pfad += "profiles/";
GetCMSProfilesDir(pfad);
if (Prefs.ProfileDir != "")
@@ -9370,7 +9371,7 @@
void ScribusApp::initHyphenator()
{
- QString pfad = LIBDIR;
+ QString pfad = ScPaths::instance().libDir();
QStringList L_German;
QStringList L_Polish;
QStringList L_English;
@@ -9559,7 +9560,7 @@
QString lang = QString(QTextCodec::locale()).left(2);
LangTransl.clear();
Prefs.Language = "English";
- pfad = LIBDIR;
+ pfad = ScPaths::instance().libDir();
pfad += "dicts/";
QDir d(pfad, "*.dic", QDir::Name, QDir::Files | QDir::NoSymLinks);
if ((d.exists()) && (d.count() != 0))
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
44,6 → 44,7
#include "tree.h"
#include "menumanager.h"
#include "scraction.h"
#include "scpaths.h"
 
 
#ifdef _MSC_VER
170,7 → 171,7
 
void run(QWidget */*d*/, ScribusApp */*plug*/)
{
QString pfad = DOCDIR;
QString pfad = ScPaths::instance().docDir();
QString pfad2;
pfad2 = QDir::convertSeparators(pfad + "en/Scripter/index.html");
HelpBrowser *dia = new HelpBrowser(0, QObject::tr("Online Reference"), Carrier->getGuiLanguage(), "scripter");
179,7 → 180,7
 
void MenuTest::buildScribusScriptsMenu()
{
QString pfad = SCRIPTSDIR;
QString pfad = ScPaths::instance().scriptDir();
QString pfad2;
pfad2 = QDir::convertSeparators(pfad);
QDir ds(pfad2, "*.py", QDir::Name, QDir::Files | QDir::NoSymLinks);
286,7 → 287,7
 
void MenuTest::StdScript(QString basefilename)
{
QString pfad = SCRIPTSDIR;
QString pfad = ScPaths::instance().scriptDir();
QString pfad2;
pfad2 = QDir::convertSeparators(pfad);
QString fn = pfad2+basefilename+".py";
/branches/Version13x/Scribus/scribus/plugins/newfromtemplateplugin/nftsettings.cpp
2,11 → 2,12
* Riku Leino, tsoots@gmail.com *
***************************************************************************/
#include "nftsettings.h"
#include "scpaths.h"
 
nftsettings::nftsettings(QString guilang, QString templateDir)
{
lang = guilang;
scribusShare = TEMPLATEDIR;
scribusShare = ScPaths::instance().templateDir();
scribusUserHome = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus");
userTemplateDir = templateDir;
if (userTemplateDir.right(1) == "/")
/branches/Version13x/Scribus/scribus/plugins/psimport/importps.cpp
19,6 → 19,7
#include <cstdlib>
#include "undomanager.h"
#include "pluginmanager.h"
#include "scpaths.h"
 
extern QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
extern QPixmap loadIcon(QString nam);
342,7 → 343,7
{
QString cmd1, cmd2, tmp, tmp2, tmp3, tmp4;
QString tmpFile = Prog->PrefsPfad+"/ps.out";
QString pfad = LIBDIR;
QString pfad = ScPaths::instance().libDir();
QString pfad2;
cmd1 = Prog->Prefs.gs_exe;
pfad2 = QDir::convertSeparators(pfad + "import.prolog");
/branches/Version13x/Scribus/scribus/langmgr.cpp
23,6 → 23,7
 
#include "config.h"
#include "langmgr.h"
#include "scpaths.h"
 
void LanguageManager::init()
{
84,7 → 85,7
 
void LanguageManager::generateInstalledLangList()
{
QString path = LIBDIR;
QString path = ScPaths::instance().libDir();
QString langAbbrev;
QMap<QString, QString>::Iterator it;
 
/branches/Version13x/Scribus/scribus/cmykfw.cpp
14,6 → 14,7
#else
#include "config.h"
#endif
#include "scpaths.h"
#ifdef HAVE_CMS
extern bool SoftProofing;
extern bool Gamut;
528,7 → 529,7
bool cus = false;
CurrSwatch.clear();
QString Cpfad = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus/"+Swatches->currentText());
QString pfadC = LIBDIR;
QString pfadC = ScPaths::instance().libDir();
QString pfadC2 = pfadC + "rgbscribus.txt";
switch (n)
{
/branches/Version13x/Scribus/scribus/undomanager.cpp
26,6 → 26,8
#include "prefsfile.h"
#include <qvaluelist.h>
 
#include "scpaths.h"
 
extern PrefsFile *prefsFile;
extern QPixmap loadIcon(QString nam);
 
756,7 → 758,7
 
void UndoManager::initIcons()
{
QString iconDir = ICONDIR;
QString iconDir = ScPaths::instance().iconDir();
 
/*** Icons for UndoObjects *******************************************/
UndoManager::IImageFrame = new QPixmap(iconDir + "Bild.xpm");
/branches/Version13x/Scribus/scribus/main.cpp
34,6 → 34,7
#include "scribus.h"
#include "langmgr.h"
#include "prefsfile.h"
#include "scpaths.h"
 
 
 
320,7 → 321,7
void installTranslators(QApplication *app, QStringList langs)
{
QTranslator *trans= new QTranslator(0);
QString path = LIBDIR;
QString path = ScPaths::instance().libDir();
path += BASE_QM;
 
bool loaded = false;
335,7 → 336,7
if (loaded)
app->installTranslator(trans);
 
path = PLUGINDIR;
path = ScPaths::instance().pluginDir();
QDir dir(path , "*.*", QDir::Name, QDir::Files | QDir::NoSymLinks);
if (dir.exists() && (dir.count() != 0)) {
for (uint i = 0; i < dir.count(); ++i) {
/branches/Version13x/Scribus/scribus/pluginmanager.cpp
9,6 → 9,7
#include "mpalette.h"
#include "tree.h"
#include "prefsfile.h"
#include "scpaths.h"
 
extern ScribusApp *ScApp;
extern PrefsFile *prefsFile;
38,7 → 39,11
int id = 0;
struct PluginData pda;
QString libPattern = QString("*.%1*").arg(PluginManager::platformDllExtension());
QDir dirList(PLUGINDIR, libPattern, QDir::Name, QDir::Files | QDir::Executable | QDir::NoSymLinks);
 
QDir dirList(ScPaths::instance().pluginDir(),
libPattern, QDir::Name,
QDir::Files | QDir::Executable | QDir::NoSymLinks);
 
if ((dirList.exists()) && (dirList.count() != 0))
{
ScApp->scrMenuMgr->addMenuSeparator("Extras");
117,7 → 122,7
pda = pluginMap[pluginID];
typedef void (*sdem)(QWidget *d, ScribusApp *plug);
sdem demo;
QString plugDir = PLUGINDIR;
QString plugDir = ScPaths::instance().pluginDir();
if (pda.type != 4 && pda.type !=5)
{
plugDir += pda.pluginFile;
180,7 → 185,7
sdem2 demo2;
sdem3 demo3;
sdemID plugID;
QString plugName = PLUGINDIR;
QString plugName = ScPaths::instance().pluginDir();
plugName += name;
 
mo = dlopen(plugName, RTLD_LAZY | RTLD_GLOBAL);
/branches/Version13x/Scribus/scribus/colorm.cpp
20,6 → 20,7
#include "query.h"
#include "scribus.h"
#include "prefsfile.h"
#include "scpaths.h"
 
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
213,7 → 214,7
LoadColSet->setText(CSets->text(id));
EditColors.clear();
QString Cpfad = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus/"+CSets->text(id));
QString pfadC = LIBDIR;
QString pfadC = ScPaths::instance().libDir();
QString pfadC2 = pfadC + "rgbscribus.txt";
switch (c)
{
/branches/Version13x/Scribus/scribus/scpaths.cpp
0,0 → 1,97
#include "scpaths.h"
#include "qstring.h"
 
// On Qt/Mac we need CoreFoundation to discover the location
// of the app bundle.
#ifdef QT_MAC
#include <CoreFoundation/CoreFoundation.h>
#endif
 
// Init the singleton's "self" address to NULL
ScPaths* ScPaths::m_instance = NULL;
 
// Singleton's public constructor
const ScPaths& ScPaths::instance()
{
if (!ScPaths::m_instance)
ScPaths::m_instance = new ScPaths();
return *ScPaths::m_instance;
}
 
// Singleton's public destructor
void ScPaths::destroy()
{
if (ScPaths::m_instance)
delete ScPaths::m_instance;
}
 
// Protected "real" constructor
// All paths are initialized to compile-time defaults passed in
// as preprocessor macros and set by autoconf.
ScPaths::ScPaths() :
m_docDir(DOCDIR),
m_iconDir(ICONDIR),
m_libDir(LIBDIR),
m_pluginDir(PLUGINDIR),
m_sampleScriptDir(SAMPLESDIR),
m_scriptDir(SCRIPTSDIR),
m_templateDir(TEMPLATEDIR)
{
// On MacOS/X, override the compile-time settings with a location
// obtained from the system.
#if defined(QT_MAC)
// Set up the various app paths to look inside the app bundle
CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef,
kCFURLPOSIXPathStyle);
const char *pathPtr = CFStringGetCStringPtr(macPath,
CFStringGetSystemEncoding());
m_docDir = strdup(QString("%1/Resources/docs/").arg(pathPtr));
m_iconDir = strdup(QString("%1/Resources/icons/").arg(pathPtr));
m_sampleDir = strdup(QString("%1/Resources/samples/").arg(pathPtr));
m_scriptDir = strdup(QString("%1/Resources/scripts/").arg(pathPtr));
m_templateDir = strdup(QString("%1/Resources/templates/").arg(pathPtr));
m_libDir = strdup(QString("%1/Resources/lib/").arg(pathPtr));
m_pluginDir = strdup(QString("%1/Resources/plugins/").arg(pathPtr));
CFRelease(pluginRef);
CFRelease(macPath);
#endif // defined(QT_MAC)
}
 
ScPaths::~ScPaths() {};
 
const QString& ScPaths::docDir() const
{
return m_docDir;
}
 
const QString& ScPaths::iconDir() const
{
return m_iconDir;
}
 
const QString& ScPaths::libDir() const
{
return m_libDir;
}
 
const QString& ScPaths::pluginDir() const
{
return m_pluginDir;
}
 
const QString& ScPaths::sampleScriptDir() const
{
return m_sampleScriptDir;
}
 
const QString& ScPaths::scriptDir() const
{
return m_scriptDir;
}
 
const QString& ScPaths::templateDir() const
{
return m_templateDir;
}
 
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Version13x/Scribus/scribus/gtgettext.cpp
===================================================================
--- Version13x/Scribus/scribus/gtgettext.cpp (revision 1692)
+++ Version13x/Scribus/scribus/gtgettext.cpp (revision 1693)
@@ -22,6 +22,7 @@
#include "gtgettext.h"
#include "pluginmanager.h"
+#include "scpaths.h"
#include "scribus.h"
extern QPixmap loadIcon(QString nam);
@@ -60,7 +61,7 @@
void gtGetText::loadImporterPlugins()
{
- QString gtdir = PLUGINDIR;
+ QString gtdir = ScPaths::instance().pluginDir();
gtdir += "gettext";
QString libPattern = QString("*.%1*").arg(PluginManager::platformDllExtension());
QDir d(gtdir, libPattern, QDir::Name, QDir::Files | QDir::Executable | QDir::NoSymLinks);
@@ -122,7 +123,7 @@
{
typedef void (*sdem)(QString filename, QString encoding, bool textOnly, gtWriter *writer);
sdem fp_GetText;
- QString pluginFilePath = QString("%1/gettext/%2").arg(PLUGINDIR).arg(idata.soFilePath);
+ QString pluginFilePath = QString("%1/gettext/%2").arg(ScPaths::instance().pluginDir()).arg(idata.soFilePath);
// This is the new, QLibrary based plugin loading code.
QLibrary gtplugin(pluginFilePath);
gtplugin.setAutoUnload(true);
@@ -143,7 +144,7 @@
typedef QStringList (*sdem1)();
sdem0 fp_FileFormatName;
sdem1 fp_FileExtensions;
- QString pluginFilePath = QString("%1/gettext/%2").arg(PLUGINDIR).arg(name);
+ QString pluginFilePath = QString("%1/gettext/%2").arg(ScPaths::instance().pluginDir()).arg(name);
QLibrary gtplugin(pluginFilePath);
gtplugin.setAutoUnload(true);