From 3d3e0fa5669e680e3545b0e8ebed17fca4c8ef6a Mon Sep 17 00:00:00 2001 From: Ayla Date: Thu, 11 Aug 2011 03:40:36 +0200 Subject: [PATCH] Read config file(s) present on both system and user-specific directories. --- src/gmenu2x.cpp | 9 ++++++++- src/gmenu2x.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index 5842249..8aa15fb 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -632,7 +632,14 @@ void GMenu2X::viewLog() { } void GMenu2X::readConfig() { - string conffile = getHome() + "/gmenu2x.conf"; + string conffile = GMENU2X_SYSTEM_DIR "/gmenu2x.conf"; + readConfig(conffile); + + conffile = getHome() + "/gmenu2x.conf"; + readConfig(conffile); +} + +void GMenu2X::readConfig(string conffile) { if (fileExists(conffile)) { ifstream inf(conffile.c_str(), ios_base::in); if (inf.is_open()) { diff --git a/src/gmenu2x.h b/src/gmenu2x.h index f5fa794..090c02b 100644 --- a/src/gmenu2x.h +++ b/src/gmenu2x.h @@ -136,6 +136,7 @@ private: string ip, defaultgw, lastSelectorDir; int lastSelectorElement; void readConfig(); + void readConfig(string path); void readTmp(); void initServices();