diff -r 2a6157d381fe -r 4c3e9fa0093b main.cpp --- a/main.cpp Mon Apr 10 11:00:19 2006 +0000 +++ b/main.cpp Mon Apr 10 11:00:23 2006 +0000 @@ -11,10 +11,6 @@ #include "options.h" #include "mainwindow.h" -#include "icons/vym-48x48.xpm" -#include "icons/vym-128x128.xpm" -#include "icons/vym-editor.xpm" - #include "flagrowobj.h" // Global variables @@ -25,6 +21,8 @@ QString tmpVymDir; // All temp files go there, created in mainwindow QString clipboardDir; // Clipboard used in all mapEditors QDir vymBaseDir; // Containing all styles, scripts, images, ... +QString iconPath; // Pointing to icons used for toolbars +QString flagsPath; // Pointing to flags bool clipboardEmpty; FlagRowObj *systemFlagsDefault; // used to copy from in LinkableMapObj FlagRowObj *standardFlagsDefault; @@ -160,10 +158,18 @@ // Use /usr/share/vym or /usr/local/share/vym or . ? QDir vymBaseDir; + + // First try options if (options.isOn ("local")) { vymBaseDir.setPath (vymBaseDir.currentDirPath()); - }else + } else + // then look for environment variable + if (getenv("VYMHOME")!=0) + { + vymBaseDir.setPath (getenv("VYMHOME")); + } else + // ok, let's find my way on my own { vymBaseDir.setPath ("/usr/share/vym"); if (!vymBaseDir.exists()) @@ -172,6 +178,9 @@ vymBaseDir.setPath(vymBaseDir.currentDirPath() ); } + iconPath=vymBaseDir.path()+"/icons/"; + flagsPath=vymBaseDir.path()+"/flags/"; + if (options.isOn ("help")) { cout << options.getHelpText()<setPixmap("vym_128x128", QPixmap(vym_128x128_xpm)); + factory->setPixmap("vym-128x128", QPixmap(iconPath+"vym-128x128.png")); qInitNetworkProtocols(); @@ -203,13 +212,13 @@ // Initialize window of TextEditor textEditor = new TextEditor(); - textEditor->setIcon (QPixmap (vym_editor_xpm)); + textEditor->setIcon (QPixmap (iconPath+"vym-editor.png")); if (textEditor->showWithMain()) textEditor->show(); // Initialize mainwindow Main m; //m.resize(m.sizeHint()); - m.setIcon (QPixmap (vym_48x48_xpm)); + m.setIcon (QPixmap (iconPath+"vym-48x48.png")); m.show(); m.fileNew(); m.loadCmdLine();