From f233a50a002c804c0494497d1aed15c7925f027d Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 19 Oct 2014 14:25:51 +0200 Subject: [PATCH] + harmonize API --- src/App/Application.cpp | 2 +- src/App/Application.h | 2 +- src/App/ApplicationPy.cpp | 2 +- src/Gui/Application.cpp | 4 ++-- src/Gui/ApplicationPy.cpp | 6 +++--- src/Gui/Assistant.cpp | 2 +- src/Gui/BitmapFactory.cpp | 4 ++-- src/Gui/NetworkRetriever.cpp | 2 +- src/Gui/OnlineDocumentation.cpp | 4 ++-- src/Gui/WidgetFactory.cpp | 2 +- src/Mod/Raytracing/App/AppRaytracingPy.cpp | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 34d797571..1af228e57 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -487,7 +487,7 @@ void Application::setActiveDocument(const char *Name) } } -const char* Application::GetHomePath(void) const +const char* Application::getHomePath(void) const { return _mConfig["AppHomePath"].c_str(); } diff --git a/src/App/Application.h b/src/App/Application.h index 1e44ee776..264254df3 100644 --- a/src/App/Application.h +++ b/src/App/Application.h @@ -223,7 +223,7 @@ public: static char** GetARGV(void){return _argv;} //@} - const char* GetHomePath(void) const; + const char* getHomePath(void) const; const char* getExecutableName(void) const; static std::string getUserAppDataDir(); static std::string getResourceDir(); diff --git a/src/App/ApplicationPy.cpp b/src/App/ApplicationPy.cpp index 3b5d1c855..d874fef66 100644 --- a/src/App/ApplicationPy.cpp +++ b/src/App/ApplicationPy.cpp @@ -531,7 +531,7 @@ PyObject* Application::sGetHomePath(PyObject * /*self*/, PyObject *args,PyObject if (!PyArg_ParseTuple(args, "")) // convert args: Python->C return NULL; // NULL triggers exception - Py::String homedir(GetApplication().GetHomePath()); + Py::String homedir(GetApplication().getHomePath()); return Py::new_reference_to(homedir); } diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 338e806d5..e5529b615 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -1617,7 +1617,7 @@ void Application::runApplication(void) } mainApp.setWindowIcon(Gui::BitmapFactory().pixmap(App::Application::Config()["AppIcon"].c_str())); QString plugin; - plugin = QString::fromUtf8(App::GetApplication().GetHomePath()); + plugin = QString::fromUtf8(App::GetApplication().getHomePath()); plugin += QLatin1String("/plugins"); QCoreApplication::addLibraryPath(plugin); @@ -1673,7 +1673,7 @@ void Application::runApplication(void) SIM::Coin3D::Quarter::Quarter::init(); SoFCDB::init(); - QString home = QString::fromUtf8(App::GetApplication().GetHomePath()); + QString home = QString::fromUtf8(App::GetApplication().getHomePath()); it = cfg.find("WindowTitle"); if (it != cfg.end()) { diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index 0d904f23a..f1a70c13e 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -699,7 +699,7 @@ PyObject* Application::sAddResPath(PyObject * /*self*/, PyObject *args,PyObject PyMem_Free(filePath); if (QDir::isRelativePath(path)) { // Home path ends with '/' - QString home = QString::fromUtf8(App::GetApplication().GetHomePath()); + QString home = QString::fromUtf8(App::GetApplication().getHomePath()); path = home + path; } @@ -718,7 +718,7 @@ PyObject* Application::sAddLangPath(PyObject * /*self*/, PyObject *args,PyObject PyMem_Free(filePath); if (QDir::isRelativePath(path)) { // Home path ends with '/' - QString home = QString::fromUtf8(App::GetApplication().GetHomePath()); + QString home = QString::fromUtf8(App::GetApplication().getHomePath()); path = home + path; } @@ -736,7 +736,7 @@ PyObject* Application::sAddIconPath(PyObject * /*self*/, PyObject *args,PyObject PyMem_Free(filePath); if (QDir::isRelativePath(path)) { // Home path ends with '/' - QString home = QString::fromUtf8(App::GetApplication().GetHomePath()); + QString home = QString::fromUtf8(App::GetApplication().getHomePath()); path = home + path; } diff --git a/src/Gui/Assistant.cpp b/src/Gui/Assistant.cpp index cbc6cd8b2..1c1b056fc 100644 --- a/src/Gui/Assistant.cpp +++ b/src/Gui/Assistant.cpp @@ -82,7 +82,7 @@ bool Assistant::startAssistant() #ifdef Q_OS_WIN QString app; app = QDir::toNativeSeparators(QString::fromUtf8 - (App::GetApplication().GetHomePath()) + QLatin1String("bin/")); + (App::GetApplication().getHomePath()) + QLatin1String("bin/")); #else QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator(); #endif diff --git a/src/Gui/BitmapFactory.cpp b/src/Gui/BitmapFactory.cpp index 94f7ff521..fea73c064 100644 --- a/src/Gui/BitmapFactory.cpp +++ b/src/Gui/BitmapFactory.cpp @@ -78,14 +78,14 @@ BitmapFactoryInst& BitmapFactoryInst::instance(void) std::map::const_iterator it; it = App::GetApplication().Config().find("ProgramIcons"); if (it != App::GetApplication().Config().end()) { - QString home = QString::fromUtf8(App::GetApplication().GetHomePath()); + QString home = QString::fromUtf8(App::GetApplication().getHomePath()); QString path = QString::fromUtf8(it->second.c_str()); if (QDir(path).isRelative()) { path = QFileInfo(QDir(home), path).absoluteFilePath(); } _pcSingleton->addPath(path); } - _pcSingleton->addPath(QString::fromAscii("%1/icons").arg(QString::fromUtf8(App::GetApplication().GetHomePath()))); + _pcSingleton->addPath(QString::fromAscii("%1/icons").arg(QString::fromUtf8(App::GetApplication().getHomePath()))); _pcSingleton->addPath(QString::fromAscii("%1/icons").arg(QString::fromUtf8(App::GetApplication().Config()["UserAppData"].c_str()))); _pcSingleton->addPath(QLatin1String(":/icons/")); _pcSingleton->addPath(QLatin1String(":/Icons/")); diff --git a/src/Gui/NetworkRetriever.cpp b/src/Gui/NetworkRetriever.cpp index 1288cc204..bb224c415 100644 --- a/src/Gui/NetworkRetriever.cpp +++ b/src/Gui/NetworkRetriever.cpp @@ -486,7 +486,7 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg) bool canStart = false; // set output directory - QString path = QString::fromUtf8(App::GetApplication().GetHomePath()); + QString path = QString::fromUtf8(App::GetApplication().getHomePath()); path += QString::fromAscii("/doc/"); ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/OnlineHelp"); path = QString::fromUtf8(hURLGrp->GetASCII( "DownloadLocation", path.toAscii() ).c_str()); diff --git a/src/Gui/OnlineDocumentation.cpp b/src/Gui/OnlineDocumentation.cpp index 8f932b262..d19c0f843 100644 --- a/src/Gui/OnlineDocumentation.cpp +++ b/src/Gui/OnlineDocumentation.cpp @@ -72,7 +72,7 @@ static const unsigned char navicon_data[] = { OnlineDocumentation::OnlineDocumentation() { // store the listed files in a stringlist - std::string path = App::GetApplication().GetHomePath(); + std::string path = App::GetApplication().getHomePath(); path += "/doc/docs.zip"; zipios::ZipFile zip(path); if (zip.isValid()) { @@ -143,7 +143,7 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const } else if (this->files.contains(fn)) { // load the requested page from zip - std::string path = App::GetApplication().GetHomePath(); + std::string path = App::GetApplication().getHomePath(); path += "/doc/docs.zip"; zipios::ZipFile zip(path); zipios::ConstEntryPointer entry = zip.getEntry((const char*)fn.toAscii()); diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp index 31cedb4a9..d1cf605d7 100644 --- a/src/Gui/WidgetFactory.cpp +++ b/src/Gui/WidgetFactory.cpp @@ -853,7 +853,7 @@ void PyResource::load( const char* name ) // checks whether it's a relative path if (fi.isRelative()) { QString cwd = QDir::currentPath (); - QString home= QDir(QString::fromUtf8(App::GetApplication().GetHomePath())).path(); + QString home= QDir(QString::fromUtf8(App::GetApplication().getHomePath())).path(); // search in cwd and home path for the file // diff --git a/src/Mod/Raytracing/App/AppRaytracingPy.cpp b/src/Mod/Raytracing/App/AppRaytracingPy.cpp index d7020adb5..e043300d2 100644 --- a/src/Mod/Raytracing/App/AppRaytracingPy.cpp +++ b/src/Mod/Raytracing/App/AppRaytracingPy.cpp @@ -219,7 +219,7 @@ copyResource(PyObject *self, PyObject *args) if (! PyArg_ParseTuple(args, "ss",&FileName,&DestDir)) return NULL; - std::string resName = App::GetApplication().GetHomePath(); + std::string resName = App::GetApplication().getHomePath(); resName += "Mod"; resName += PATHSEP ; resName += "Raytracing";