diff --git a/src/UI/PluginCreator.C b/src/UI/PluginCreator.C index c23395ac..b097fe39 100644 --- a/src/UI/PluginCreator.C +++ b/src/UI/PluginCreator.C @@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "Globals.h" #include "PluginCreator.h" -#include "PathChange.h" +#include "ChangeDir.h" namespace UI { @@ -57,7 +57,7 @@ namespace UI { if (isSourceFile(lib_name)) { - PathChange path_changer(current_dir.absolutePath()+"/plugins/"+type); + ChangeDir path_changer(current_dir.absolutePath()+"/plugins/"+type); lib_name = lib_name.remove(".C"); @@ -102,7 +102,7 @@ namespace UI { setupPluginDirectoryStructure(type); - PathChange path_changer(*(Globals::Instance().rcdirs().begin())+"/plugins/"+type); + ChangeDir path_changer(*(Globals::Instance().rcdirs().begin())+"/plugins/"+type); // we are now in the subdirectory plugins/type under the first entry of the rcdirs list writeSource(); // generate C++ source code @@ -123,7 +123,7 @@ namespace UI { } void PluginCreator::setupPluginDirectoryStructure(const QString& type) { - PathChange path_changer(*(Globals::Instance().rcdirs().begin())); + ChangeDir path_changer(*(Globals::Instance().rcdirs().begin())); if (!QDir::current().exists ("plugins")) QDir::current().mkdir ("plugins"); if (!QDir::current().exists ("plugins/"+type)) QDir::current().mkdir ("plugins/"+type); diff --git a/src/Utilities/PathChange.C b/src/Utilities/ChangeDir.C similarity index 91% rename from src/Utilities/PathChange.C rename to src/Utilities/ChangeDir.C index f007f69a..91bd53f8 100644 --- a/src/Utilities/PathChange.C +++ b/src/Utilities/ChangeDir.C @@ -18,12 +18,12 @@ with this program; if not, write to the Free Software Foundation, Inc., */ -#include "PathChange.h" +#include "ChangeDir.h" #include #include -PathChange::PathChange(const QString &newPath) { +ChangeDir::ChangeDir(const QString &newPath) { if (QFile::exists(newPath) && QFileInfo(newPath).isDir()) { old_path = QDir::currentPath(); QDir::setCurrent(newPath); @@ -32,6 +32,6 @@ PathChange::PathChange(const QString &newPath) { } } -PathChange::~PathChange() { +ChangeDir::~ChangeDir() { if (old_path != INVALID_PATH) QDir::setCurrent(old_path); } diff --git a/src/Utilities/PathChange.h b/src/Utilities/ChangeDir.h similarity index 92% rename from src/Utilities/PathChange.h rename to src/Utilities/ChangeDir.h index 5e5c0a9e..414f0d3b 100644 --- a/src/Utilities/PathChange.h +++ b/src/Utilities/ChangeDir.h @@ -23,9 +23,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include -struct PathChange { - PathChange(const QString &newPath); - ~PathChange(); +struct ChangeDir { + ChangeDir(const QString &newPath); + ~ChangeDir(); private: QString old_path; diff --git a/src/Utilities/Utilities.pri b/src/Utilities/Utilities.pri index 57e3f503..9859d938 100644 --- a/src/Utilities/Utilities.pri +++ b/src/Utilities/Utilities.pri @@ -3,6 +3,7 @@ INCLUDEPATH += $${PATH} DEPENDPATH += $${PATH} HEADERS += \ + $${PATH}/ChangeDir.h \ $${PATH}/FunctionDLL.h \ $${PATH}/Globals.h \ $${PATH}/GLUPerspective.h \ @@ -12,7 +13,6 @@ HEADERS += \ $${PATH}/NotYetImplementedException.h \ $${PATH}/Observer.h \ $${PATH}/Observer.impl.h \ - $${PATH}/PathChange.h \ $${PATH}/ScopedTimer.h \ $${PATH}/SingletonHolder.h \ $${PATH}/Tree.h \ @@ -20,9 +20,9 @@ HEADERS += \ $${PATH}/Util.h SOURCES += \ + $${PATH}/ChangeDir.C \ $${PATH}/FunctionDLL.C \ $${PATH}/Globals.C \ $${PATH}/GLUPerspective.cpp \ - $${PATH}/PathChange.C \ $${PATH}/ScopedTimer.cpp \ $${PATH}/Util.cpp