main.cpp
changeset 215 e211e2fc9d54
parent 205 30c4a6c7ff10
child 243 fad762341d2d
     1.1 --- a/main.cpp	Tue Feb 21 16:18:23 2006 +0000
     1.2 +++ b/main.cpp	Tue Feb 21 16:18:23 2006 +0000
     1.3 @@ -24,6 +24,7 @@
     1.4  Main *mainWindow;				// used in BranchObj::select()								
     1.5  QString tmpVymDir;				// All temp files go there, created in mainwindow
     1.6  QString clipboardDir;			// Clipboard used in all mapEditors
     1.7 +QDir vymBaseDir;				// Containing all styles, scripts, images, ...
     1.8  bool clipboardEmpty;			
     1.9  FlagRowObj *systemFlagsDefault;	// used to copy from in LinkableMapObj
    1.10  FlagRowObj *standardFlagsDefault;
    1.11 @@ -131,17 +132,17 @@
    1.12      factory->setPixmap("vym_128x128", QPixmap(vym_128x128_xpm));
    1.13      qInitNetworkProtocols();
    1.14  
    1.15 -	// Use /usr/share/vym or /usr/local/share/vym or .
    1.16 -	QDir shareDir;
    1.17 -	shareDir.setPath ("/usr/share/vym");
    1.18 -	if (!shareDir.exists())
    1.19 -        shareDir.setPath ("/usr/local/share/vym");
    1.20 -	if (!shareDir.exists())
    1.21 -        shareDir.setPath(".");
    1.22 +	// Use /usr/share/vym or /usr/local/share/vym or . ?
    1.23 +	QDir vymBaseDir;
    1.24 +	vymBaseDir.setPath ("/usr/share/vym");
    1.25 +	if (!vymBaseDir.exists())
    1.26 +        vymBaseDir.setPath ("/usr/local/share/vym");
    1.27 +	if (!vymBaseDir.exists())
    1.28 +        vymBaseDir.setPath(vymBaseDir.currentDirPath() );
    1.29  
    1.30  	// Initialize translations
    1.31  	QTranslator translator (0);
    1.32 -	translator.load( QString("vym_")+QTextCodec::locale(), shareDir.path() + "/lang");
    1.33 +	translator.load( QString("vym_")+QTextCodec::locale(), vymBaseDir.path() + "/lang");
    1.34      app.installTranslator( &translator );
    1.35  
    1.36  	// Initializing the row of system flags