Skip to content

Commit

Permalink
renamed PathChanger to ChangeDir
Browse files Browse the repository at this point in the history
  • Loading branch information
lene committed Mar 28, 2014
1 parent 69609ac commit e1a77db
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/UI/PluginCreator.C
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/Utilities/PathChange.C → src/Utilities/ChangeDir.C
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/

#include "PathChange.h"
#include "ChangeDir.h"

#include <QDir>
#include <iostream>

PathChange::PathChange(const QString &newPath) {
ChangeDir::ChangeDir(const QString &newPath) {
if (QFile::exists(newPath) && QFileInfo(newPath).isDir()) {
old_path = QDir::currentPath();
QDir::setCurrent(newPath);
Expand All @@ -32,6 +32,6 @@ PathChange::PathChange(const QString &newPath) {
}
}

PathChange::~PathChange() {
ChangeDir::~ChangeDir() {
if (old_path != INVALID_PATH) QDir::setCurrent(old_path);
}
6 changes: 3 additions & 3 deletions src/Utilities/PathChange.h → src/Utilities/ChangeDir.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,

#include <QString>

struct PathChange {
PathChange(const QString &newPath);
~PathChange();
struct ChangeDir {
ChangeDir(const QString &newPath);
~ChangeDir();

private:
QString old_path;
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/Utilities.pri
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ INCLUDEPATH += $${PATH}
DEPENDPATH += $${PATH}

HEADERS += \
$${PATH}/ChangeDir.h \
$${PATH}/FunctionDLL.h \
$${PATH}/Globals.h \
$${PATH}/GLUPerspective.h \
Expand All @@ -12,17 +13,16 @@ HEADERS += \
$${PATH}/NotYetImplementedException.h \
$${PATH}/Observer.h \
$${PATH}/Observer.impl.h \
$${PATH}/PathChange.h \
$${PATH}/ScopedTimer.h \
$${PATH}/SingletonHolder.h \
$${PATH}/Tree.h \
$${PATH}/Tree.impl.h \
$${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

0 comments on commit e1a77db

Please sign in to comment.