From 3000386443acf0a8214994aaa14e59c68eb6d05f Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Wed, 16 Oct 2013 13:07:26 +0200 Subject: [PATCH 01/14] failed attempt on switch adding. --- apps/opencs/editor.cpp | 54 +++++++++++++++++++++++++++++++++++++++++- apps/opencs/editor.hpp | 5 +++- apps/opencs/main.cpp | 2 +- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index a43059795..4c75ed1cc 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -6,6 +6,8 @@ #include #include +#include + #include "model/doc/document.hpp" #include "model/world/data.hpp" @@ -208,8 +210,13 @@ void CS::Editor::connectToIPCServer() mClientSocket->close(); } -int CS::Editor::run() +int CS::Editor::run(int argc, char** argv) { + if (!parseOptions(argc, argv) ) + { + return 0; + } + if (mLocal.empty()) return 1; @@ -219,3 +226,48 @@ int CS::Editor::run() return QApplication::exec(); } + +bool CS::Editor::parseOptions (int argc, char** argv) +{ + // Create a local alias for brevity + namespace bpo = boost::program_options; + typedef std::vector StringsVector; + + bpo::options_description desc("Syntax: openmw \nAllowed options"); + + desc.add_options() + ("help", "print help message") + + ("resources", bpo::value()->default_value("resources"), "set resources directory"); + + bpo::parsed_options valid_opts = bpo::command_line_parser(argc, argv).options(desc).allow_unregistered().run(); + + bpo::variables_map variables; + + // Runtime options override settings from all configs + bpo::store(valid_opts, variables); + bpo::notify(variables); + +// cfgMgr.readConfiguration(variables, desc); + + bool run = true; + + if (variables.count ("help")) + { + std::cout << desc << std::endl; + run = false; + } + + if (!run) + return false; + + setResourceDir(variables["resources"].as()); + + return true; +} + +// Set resource dir +void CS::Editor::setResourceDir (const boost::filesystem::path& parResDir) +{ + mResDir = boost::filesystem::system_complete(parResDir); +} \ No newline at end of file diff --git a/apps/opencs/editor.hpp b/apps/opencs/editor.hpp index 16f6b9516..77ba0993e 100644 --- a/apps/opencs/editor.hpp +++ b/apps/opencs/editor.hpp @@ -50,7 +50,7 @@ namespace CS bool makeIPCServer(); void connectToIPCServer(); - int run(); + int run(int argc, char** argv); ///< \return error status private slots: @@ -66,12 +66,15 @@ namespace CS void showStartup(); void showSettings(); + bool parseOptions (int argc, char** argv); + void setResourceDir (const boost::filesystem::path& parResDir); private: QString mIpcServerName; QLocalServer *mServer; QLocalSocket *mClientSocket; + boost::filesystem::path mResDir; }; } diff --git a/apps/opencs/main.cpp b/apps/opencs/main.cpp index e5e7514ce..bec09bd4a 100644 --- a/apps/opencs/main.cpp +++ b/apps/opencs/main.cpp @@ -45,5 +45,5 @@ int main(int argc, char *argv[]) // return 0; } - return editor.run(); + return editor.run(argc, argv); } From a7002e8a09602f4dfcbe3e1031ab6a4ef365cbad Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Thu, 17 Oct 2013 18:21:41 +0200 Subject: [PATCH 02/14] Implements switch (--help and --resources), and copying defaultfilters.omwaddon.project. Seems to work. --- apps/opencs/editor.cpp | 17 ++++------------- apps/opencs/editor.hpp | 2 -- apps/opencs/model/doc/document.cpp | 10 +++++----- apps/opencs/model/doc/document.hpp | 7 +++---- apps/opencs/model/doc/documentmanager.cpp | 7 ++++++- apps/opencs/model/doc/documentmanager.hpp | 7 +++++-- 6 files changed, 23 insertions(+), 27 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 4c75ed1cc..d5888a312 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -6,8 +6,6 @@ #include #include -#include - #include "model/doc/document.hpp" #include "model/world/data.hpp" @@ -59,7 +57,7 @@ void CS::Editor::setupDataFiles() if (!variables["data"].empty()) { dataDirs = Files::PathContainer(variables["data"].as()); } - + std::string local = variables["data-local"].as(); if (!local.empty()) { dataLocal.push_back(Files::PathContainer::value_type(local)); @@ -231,9 +229,8 @@ bool CS::Editor::parseOptions (int argc, char** argv) { // Create a local alias for brevity namespace bpo = boost::program_options; - typedef std::vector StringsVector; - bpo::options_description desc("Syntax: openmw \nAllowed options"); + bpo::options_description desc("Syntax: opencs \nAllowed options"); desc.add_options() ("help", "print help message") @@ -248,7 +245,7 @@ bool CS::Editor::parseOptions (int argc, char** argv) bpo::store(valid_opts, variables); bpo::notify(variables); -// cfgMgr.readConfiguration(variables, desc); + mCfgMgr.readConfiguration(variables, desc); bool run = true; @@ -261,13 +258,7 @@ bool CS::Editor::parseOptions (int argc, char** argv) if (!run) return false; - setResourceDir(variables["resources"].as()); + mDocumentManager.setResourceDir(variables["resources"].as()); return true; -} - -// Set resource dir -void CS::Editor::setResourceDir (const boost::filesystem::path& parResDir) -{ - mResDir = boost::filesystem::system_complete(parResDir); } \ No newline at end of file diff --git a/apps/opencs/editor.hpp b/apps/opencs/editor.hpp index 77ba0993e..763cde100 100644 --- a/apps/opencs/editor.hpp +++ b/apps/opencs/editor.hpp @@ -67,14 +67,12 @@ namespace CS void showSettings(); bool parseOptions (int argc, char** argv); - void setResourceDir (const boost::filesystem::path& parResDir); private: QString mIpcServerName; QLocalServer *mServer; QLocalSocket *mClientSocket; - boost::filesystem::path mResDir; }; } diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index 5c29d9f61..afb68b440 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -2146,10 +2146,8 @@ void CSMDoc::Document::createBase() } } -CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, - const std::vector& files, - const boost::filesystem::path& savePath, bool new_) -: mSavePath (savePath), mContentFiles (files), mTools (mData), +CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, const std::vector< boost::filesystem::path >& files, const boost::filesystem::path& savePath, const boost::filesystem::path& resDir, bool new_) +: mSavePath (savePath), mContentFiles (files), mTools (mData), mResDir(resDir), mProjectPath ((configuration.getUserPath() / "projects") / (savePath.filename().string() + ".project")), mSaving (*this, mProjectPath) @@ -2183,7 +2181,9 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, } else { - /// \todo create new project file with default filters + boost::filesystem::path filters = mResDir; + filters /= "defaultfilters.omwaddon.project"; + boost::filesystem::copy_file(mResDir, mProjectPath); } } diff --git a/apps/opencs/model/doc/document.hpp b/apps/opencs/model/doc/document.hpp index d171dacae..e6d1b0c87 100644 --- a/apps/opencs/model/doc/document.hpp +++ b/apps/opencs/model/doc/document.hpp @@ -43,13 +43,14 @@ namespace CSMDoc CSMTools::Tools mTools; boost::filesystem::path mProjectPath; Saving mSaving; + boost::filesystem::path mResDir; // It is important that the undo stack is declared last, because on desctruction it fires a signal, that is connected to a slot, that is // using other member variables. Unfortunately this connection is cut only in the QObject destructor, which is way too late. QUndoStack mUndoStack; // not implemented - Document (const Document&); + Document (const Files::ConfigurationManager& configuration, const std::vector< boost::filesystem::path >& files, const boost::filesystem::path& savePath, bool new_); Document& operator= (const Document&); void load (const std::vector::const_iterator& begin, @@ -70,9 +71,7 @@ namespace CSMDoc public: - Document (const Files::ConfigurationManager& configuration, - const std::vector& files, - const boost::filesystem::path& savePath, bool new_); + Document (const Files::ConfigurationManager& configuration, const std::vector< boost::filesystem::path >& files, const boost::filesystem::path& savePath, const boost::filesystem::path& resDir, bool new_); ~Document(); diff --git a/apps/opencs/model/doc/documentmanager.cpp b/apps/opencs/model/doc/documentmanager.cpp index 1d6c88dcc..024c46bea 100644 --- a/apps/opencs/model/doc/documentmanager.cpp +++ b/apps/opencs/model/doc/documentmanager.cpp @@ -30,7 +30,7 @@ CSMDoc::DocumentManager::~DocumentManager() CSMDoc::Document *CSMDoc::DocumentManager::addDocument (const std::vector& files, const boost::filesystem::path& savePath, bool new_) { - Document *document = new Document (mConfiguration, files, savePath, new_); + Document *document = new Document (mConfiguration, files, savePath, mResDir, new_); mDocuments.push_back (document); @@ -48,4 +48,9 @@ bool CSMDoc::DocumentManager::removeDocument (Document *document) delete document; return mDocuments.empty(); +} + +void CSMDoc::DocumentManager::setResourceDir (const boost::filesystem::path& parResDir) +{ + mResDir = boost::filesystem::system_complete(parResDir); } \ No newline at end of file diff --git a/apps/opencs/model/doc/documentmanager.hpp b/apps/opencs/model/doc/documentmanager.hpp index 28a21216a..b80a18642 100644 --- a/apps/opencs/model/doc/documentmanager.hpp +++ b/apps/opencs/model/doc/documentmanager.hpp @@ -29,8 +29,7 @@ namespace CSMDoc ~DocumentManager(); - Document *addDocument (const std::vector& files, - const boost::filesystem::path& savePath, bool new_); + Document *addDocument (const std::vector< boost::filesystem::path >& files, const boost::filesystem::path& savePath, bool new_); ///< The ownership of the returned document is not transferred to the caller. /// /// \param new_ Do not load the last content file in \a files and instead create in an @@ -38,6 +37,10 @@ namespace CSMDoc bool removeDocument (Document *document); ///< \return last document removed? + void setResourceDir (const boost::filesystem::path& parResDir); + + private: + boost::filesystem::path mResDir; }; } From 4e26a61db3f217a8bf4bb6ce2f36e8a0a65b57c5 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Fri, 18 Oct 2013 22:11:14 +0200 Subject: [PATCH 03/14] Removed command line handling. Maybe zini will let me to implement it later. Implemented switch to handle resources directory. TODO: check for defaultfilters on data path. --- apps/opencs/editor.cpp | 55 ++++++------------------------------------ apps/opencs/editor.hpp | 3 +-- apps/opencs/main.cpp | 2 +- 3 files changed, 10 insertions(+), 50 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index d5888a312..97c958f3d 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -41,13 +41,14 @@ CS::Editor::Editor() void CS::Editor::setupDataFiles() { boost::program_options::variables_map variables; - boost::program_options::options_description desc; - + boost::program_options::options_description desc("Syntax: opencs \nAllowed options"); + desc.add_options() ("data", boost::program_options::value()->default_value(Files::PathContainer(), "data")->multitoken()) ("data-local", boost::program_options::value()->default_value("")) ("fs-strict", boost::program_options::value()->implicit_value(true)->default_value(false)) - ("encoding", boost::program_options::value()->default_value("win1252")); + ("encoding", boost::program_options::value()->default_value("win1252")) + ("resources", boost::program_options::value()->default_value("resources"), "set resources directory"); boost::program_options::notify(variables); @@ -86,6 +87,9 @@ void CS::Editor::setupDataFiles() //mFileDialog.setEncoding(encoding); dataDirs.insert (dataDirs.end(), dataLocal.begin(), dataLocal.end()); + +// Setting Resources directory. + mDocumentManager.setResourceDir(variables["resources"].as()); for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter) { @@ -208,13 +212,8 @@ void CS::Editor::connectToIPCServer() mClientSocket->close(); } -int CS::Editor::run(int argc, char** argv) +int CS::Editor::run() { - if (!parseOptions(argc, argv) ) - { - return 0; - } - if (mLocal.empty()) return 1; @@ -223,42 +222,4 @@ int CS::Editor::run(int argc, char** argv) QApplication::setQuitOnLastWindowClosed (true); return QApplication::exec(); -} - -bool CS::Editor::parseOptions (int argc, char** argv) -{ - // Create a local alias for brevity - namespace bpo = boost::program_options; - - bpo::options_description desc("Syntax: opencs \nAllowed options"); - - desc.add_options() - ("help", "print help message") - - ("resources", bpo::value()->default_value("resources"), "set resources directory"); - - bpo::parsed_options valid_opts = bpo::command_line_parser(argc, argv).options(desc).allow_unregistered().run(); - - bpo::variables_map variables; - - // Runtime options override settings from all configs - bpo::store(valid_opts, variables); - bpo::notify(variables); - - mCfgMgr.readConfiguration(variables, desc); - - bool run = true; - - if (variables.count ("help")) - { - std::cout << desc << std::endl; - run = false; - } - - if (!run) - return false; - - mDocumentManager.setResourceDir(variables["resources"].as()); - - return true; } \ No newline at end of file diff --git a/apps/opencs/editor.hpp b/apps/opencs/editor.hpp index 763cde100..16f6b9516 100644 --- a/apps/opencs/editor.hpp +++ b/apps/opencs/editor.hpp @@ -50,7 +50,7 @@ namespace CS bool makeIPCServer(); void connectToIPCServer(); - int run(int argc, char** argv); + int run(); ///< \return error status private slots: @@ -66,7 +66,6 @@ namespace CS void showStartup(); void showSettings(); - bool parseOptions (int argc, char** argv); private: diff --git a/apps/opencs/main.cpp b/apps/opencs/main.cpp index bec09bd4a..e5e7514ce 100644 --- a/apps/opencs/main.cpp +++ b/apps/opencs/main.cpp @@ -45,5 +45,5 @@ int main(int argc, char *argv[]) // return 0; } - return editor.run(argc, argv); + return editor.run(); } From 184456892b4abc42b4db73f66ecb82c21073011e Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Sat, 19 Oct 2013 18:43:47 +0200 Subject: [PATCH 04/14] Added check to load custom filters set when present. --- apps/opencs/editor.cpp | 21 +++++++++++---------- apps/opencs/model/doc/document.cpp | 26 +++++++++++++++++--------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 97c958f3d..9abc9ee78 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -8,10 +8,11 @@ #include "model/doc/document.hpp" #include "model/world/data.hpp" +#include CS::Editor::Editor() -: mDocumentManager (mCfgMgr), mViewManager (mDocumentManager) + : mDocumentManager (mCfgMgr), mViewManager (mDocumentManager) { mIpcServerName = "org.openmw.OpenCS"; @@ -32,23 +33,23 @@ CS::Editor::Editor() connect (&mFileDialog, SIGNAL(openFiles()), this, SLOT(openFiles())); connect (&mFileDialog, SIGNAL(createNewFile (const boost::filesystem::path&)), - this, SLOT(createNewFile (const boost::filesystem::path&))); + this, SLOT(createNewFile (const boost::filesystem::path&))); connect (&mNewGame, SIGNAL (createRequest (const boost::filesystem::path&)), - this, SLOT (createNewGame (const boost::filesystem::path&))); + this, SLOT (createNewGame (const boost::filesystem::path&))); } void CS::Editor::setupDataFiles() { boost::program_options::variables_map variables; boost::program_options::options_description desc("Syntax: opencs \nAllowed options"); - + desc.add_options() ("data", boost::program_options::value()->default_value(Files::PathContainer(), "data")->multitoken()) ("data-local", boost::program_options::value()->default_value("")) ("fs-strict", boost::program_options::value()->implicit_value(true)->default_value(false)) ("encoding", boost::program_options::value()->default_value("win1252")) - ("resources", boost::program_options::value()->default_value("resources"), "set resources directory"); + ("resources", boost::program_options::value()->default_value("resources")); boost::program_options::notify(variables); @@ -58,7 +59,7 @@ void CS::Editor::setupDataFiles() if (!variables["data"].empty()) { dataDirs = Files::PathContainer(variables["data"].as()); } - + std::string local = variables["data-local"].as(); if (!local.empty()) { dataLocal.push_back(Files::PathContainer::value_type(local)); @@ -83,12 +84,12 @@ void CS::Editor::setupDataFiles() } // Set the charset for reading the esm/esp files - // QString encoding = QString::fromStdString(variables["encoding"].as()); + // QString encoding = QString::fromStdString(variables["encoding"].as()); //mFileDialog.setEncoding(encoding); dataDirs.insert (dataDirs.end(), dataLocal.begin(), dataLocal.end()); - -// Setting Resources directory. + +// Adding Resources directory. First check if there is a file defaultfilters in the user path. mDocumentManager.setResourceDir(variables["resources"].as()); for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter) @@ -222,4 +223,4 @@ int CS::Editor::run() QApplication::setQuitOnLastWindowClosed (true); return QApplication::exec(); -} \ No newline at end of file +} diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index afb68b440..32c728f88 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -9,7 +9,7 @@ #endif void CSMDoc::Document::load (const std::vector::const_iterator& begin, - const std::vector::const_iterator& end, bool lastAsModified) + const std::vector::const_iterator& end, bool lastAsModified) { assert (begin!=end); @@ -2147,10 +2147,10 @@ void CSMDoc::Document::createBase() } CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, const std::vector< boost::filesystem::path >& files, const boost::filesystem::path& savePath, const boost::filesystem::path& resDir, bool new_) -: mSavePath (savePath), mContentFiles (files), mTools (mData), mResDir(resDir), - mProjectPath ((configuration.getUserPath() / "projects") / - (savePath.filename().string() + ".project")), - mSaving (*this, mProjectPath) + : mSavePath (savePath), mContentFiles (files), mTools (mData), mResDir(resDir), + mProjectPath ((configuration.getUserPath() / "projects") / + (savePath.filename().string() + ".project")), + mSaving (*this, mProjectPath) { if (files.empty()) throw std::runtime_error ("Empty content file sequence"); @@ -2181,9 +2181,17 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, co } else { - boost::filesystem::path filters = mResDir; - filters /= "defaultfilters.omwaddon.project"; - boost::filesystem::copy_file(mResDir, mProjectPath); + boost::filesystem::path locCustomFiltersPath (configuration.getUserPath()); + locCustomFiltersPath /= "defaultfilters.omwaddon.project"; + if (boost::filesystem::exists(locCustomFiltersPath)) + { + boost::filesystem::copy(locCustomFiltersPath, mProjectPath); + } else { + boost::filesystem::path filters(mResDir); + filters /= "defaultfilters.omwaddon.project"; + boost::filesystem::copy_file(filters, mProjectPath); + } + getData().loadFile (mProjectPath, false, true); } } @@ -2198,7 +2206,7 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, co connect (&mSaving, SIGNAL (progress (int, int, int)), this, SLOT (progress (int, int, int))); connect (&mSaving, SIGNAL (done (int)), this, SLOT (operationDone (int))); connect (&mSaving, SIGNAL (reportMessage (const QString&, int)), - this, SLOT (reportMessage (const QString&, int))); + this, SLOT (reportMessage (const QString&, int))); } CSMDoc::Document::~Document() From 762cbf62785d8f26ea2d58bcf24a65f32bedf64d Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Sat, 19 Oct 2013 18:51:36 +0200 Subject: [PATCH 05/14] Changed gauntlets filter. It showes now both gauntlets and bracers. --- files/opencs/defaultfilters.omwaddon.project | Bin 0 -> 10544 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 files/opencs/defaultfilters.omwaddon.project diff --git a/files/opencs/defaultfilters.omwaddon.project b/files/opencs/defaultfilters.omwaddon.project new file mode 100644 index 0000000000000000000000000000000000000000..e58ed92786f2e0333519341d24f008e772828e34 GIT binary patch literal 10544 zcmeHNOK&4f6`s50{k*)Pu6a3-JK_#(7=f;wOlA_4nH%E3@DM`fb~$d+?zXzx$pnEI z-a;%83nU~EumKjZVaE?(#joN#>Qq;i+jd6IlHPROed>H)omW+z&e_56^Iv%Bj=v5M z9-QvN@5$tEultAp|6{EM9v&T^eKU}FGI)IOPWU~qtM8etxqtu4=y_GzJ1F>3cww75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s!Ek?D6tTEu&=zP> zMp{k-3nwO6x14=892CVqD_pjRdcp|)Nx70 z1%|2=cGE>e_w=Ix5z&!xC;1IWIgt-5kTCHDbPtq?0or7Qhb}~ZmP|hi5kZ*aj)iP+ z1mbH_Q3kA~bb{KJI1vV0>8A;&PAfsl;x6)SPy%)r|)InL=Z`)=*-Kxoy~h<$e}h5}_m z>CHk35tz`=6FYSVI8@D=&2&4_1loj>w-RAE=iQ9d#jTP;ZOf$asU!8T#8RCRbzW3b zoEwl|QwwDM+OUm!L<%=9$|B~LWN%gG!>(Ri%6TtqcbzMP8IOds%oN0 zF%wBEcGP2%k^Z1gX2M=dLPjjK@0uB%gnVm5)V72?K)2hXZ`i)IVXOtK=ei(PuLG+! zRXc9M9LP}g88^BVTg{gauiYwWqd2$yC~;eS#FL)O#LRTT8-Xvq2&;!QZi$lbBeULs z&SgR;>X=-ZYYv_b$DdVA*CVSyMazcm<98ycp1n0mSVXZLX(va062z16aj_i9GMt|~ zzPlR+?(+mSTGie6Bg$|WANN5X;=?zL<0Xp+wAIv&bpNE1gob+=|KG(A6F!j@93Pt( zm+qfazW73PcwofFf63r?F`4HHnaDUkfouT>(zTV(IVMh?c2hwL+|M1CKz;{9FI|ZI zAmI}k$Mf-7^JO+p`?(`_R!pbOnu&&gsOkw3-)2O$LDFE0TrO;@MT?Fe!+)cYNwDTf zm_Dw?`6M@EOojnUq)QGB<7_w<-Ed#-Vrt6<4?D7<_B{}A%6+Dd;2G=wTB1AJo7H9p zTUaI^u9%_v2L_H!p1yCcjQKHxd?Nvg8V56H2{KXGiVacx-<&sSU|I`h@ZCHA1I?m& AoB#j- literal 0 HcmV?d00001 From cafea438bdc1108c0a6cdf1f183b453ee2ef2bf9 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Sun, 20 Oct 2013 09:44:10 +0200 Subject: [PATCH 06/14] Added missing light filter. --- files/opencs/defaultfilters.omwaddon.project | Bin 10544 -> 10962 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/files/opencs/defaultfilters.omwaddon.project b/files/opencs/defaultfilters.omwaddon.project index e58ed92786f2e0333519341d24f008e772828e34..c66990fdc2c26863fa33edefe0d336ef9ae8fa3b 100644 GIT binary patch delta 295 zcmdlGbSZR$f#&43jEX!tnduoN#SCtqJ|VJ`8+j#FeLw=53@)z0&VmdK48a-s(uCL|53?mdFQ-x=FF#KKW+aN8{gW9bWh5YW7MCQJWF~`cbVAtZ53?~Z Mzl3yKbunxO07-RSssI20 delta 7 OcmcZ Date: Sun, 20 Oct 2013 09:50:16 +0200 Subject: [PATCH 07/14] Added configrue file in cmake. Hopefully it will copy defaultfilters file. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 625239aa0..a436d1fc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,6 +319,9 @@ configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg configure_file(${OpenMW_SOURCE_DIR}/files/opencs.cfg "${OpenMW_BINARY_DIR}/opencs.cfg") + +configure_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters.omwaddon.project + "${OpenMW_BINARY_DIR}/resources/defaultfilters.omwaddon.project") if (NOT WIN32 AND NOT APPLE) configure_file(${OpenMW_SOURCE_DIR}/files/openmw.desktop From 6b293961b4c7ee5152a282a6c245ec57c227b128 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Sun, 20 Oct 2013 10:02:33 +0200 Subject: [PATCH 08/14] This appears to work. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a436d1fc3..2a902eb83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,7 +321,7 @@ configure_file(${OpenMW_SOURCE_DIR}/files/opencs.cfg "${OpenMW_BINARY_DIR}/opencs.cfg") configure_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters.omwaddon.project - "${OpenMW_BINARY_DIR}/resources/defaultfilters.omwaddon.project") + "${OpenMW_BINARY_DIR}/resources/defaultfilters.omwaddon.project" COPYONLY) if (NOT WIN32 AND NOT APPLE) configure_file(${OpenMW_SOURCE_DIR}/files/openmw.desktop From 96b6787255fb4596a0b02d3cecc438c086e29c73 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Sun, 20 Oct 2013 10:56:27 +0200 Subject: [PATCH 09/14] Getting rid of extension. Correcting tiny mistake in filters file. --- CMakeLists.txt | 2 +- apps/opencs/model/doc/document.cpp | 4 ++-- files/opencs/defaultfilters.omwaddon.project | Bin 10962 -> 10958 bytes 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a902eb83..df2986715 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,7 +321,7 @@ configure_file(${OpenMW_SOURCE_DIR}/files/opencs.cfg "${OpenMW_BINARY_DIR}/opencs.cfg") configure_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters.omwaddon.project - "${OpenMW_BINARY_DIR}/resources/defaultfilters.omwaddon.project" COPYONLY) + "${OpenMW_BINARY_DIR}/resources/defaultfilters" COPYONLY) if (NOT WIN32 AND NOT APPLE) configure_file(${OpenMW_SOURCE_DIR}/files/openmw.desktop diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index 32c728f88..fd2b32861 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -2182,13 +2182,13 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, co else { boost::filesystem::path locCustomFiltersPath (configuration.getUserPath()); - locCustomFiltersPath /= "defaultfilters.omwaddon.project"; + locCustomFiltersPath /= "customfilters.omwaddon.project"; if (boost::filesystem::exists(locCustomFiltersPath)) { boost::filesystem::copy(locCustomFiltersPath, mProjectPath); } else { boost::filesystem::path filters(mResDir); - filters /= "defaultfilters.omwaddon.project"; + filters /= "defaultfilters"; boost::filesystem::copy_file(filters, mProjectPath); } getData().loadFile (mProjectPath, false, true); diff --git a/files/opencs/defaultfilters.omwaddon.project b/files/opencs/defaultfilters.omwaddon.project index c66990fdc2c26863fa33edefe0d336ef9ae8fa3b..0ac3c8db4bd939b8b9d559ab4af4056fc0b8d80e 100644 GIT binary patch delta 37 tcmcZXdMR|nEKSDV$rIINCU4h_oV;2~aI&n{MgWvH3W5Lt From b138533bf307332852d907b181114f53b2bf4d91 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Sun, 20 Oct 2013 17:21:09 +0200 Subject: [PATCH 10/14] renamed defaultfilter.omwaddon.project to defaultfilters. --- CMakeLists.txt | 2 +- files/opencs/defaultfilters.omwaddon.project | Bin 10958 -> 0 bytes 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 files/opencs/defaultfilters.omwaddon.project diff --git a/CMakeLists.txt b/CMakeLists.txt index df2986715..cfb682cdb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -320,7 +320,7 @@ configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg configure_file(${OpenMW_SOURCE_DIR}/files/opencs.cfg "${OpenMW_BINARY_DIR}/opencs.cfg") -configure_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters.omwaddon.project +configure_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters "${OpenMW_BINARY_DIR}/resources/defaultfilters" COPYONLY) if (NOT WIN32 AND NOT APPLE) diff --git a/files/opencs/defaultfilters.omwaddon.project b/files/opencs/defaultfilters.omwaddon.project deleted file mode 100644 index 0ac3c8db4bd939b8b9d559ab4af4056fc0b8d80e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10958 zcmeHN%Woq|8K1rKelD=EP-|WeWJm14g%PlFGMPzGW;VoO2Ux9E<#yR_((bmp+sOoh z7~Vo0RveI!K)?k!z=a!s04M$`zDIr4Rn=`fBj<=Oj=R75e!u!&RrOWQ4u)U;%5%5e z=kV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kochanowicz Date: Mon, 21 Oct 2013 16:06:16 +0200 Subject: [PATCH 11/14] Removed old comment. Changed to set resources path correctly. --- apps/opencs/editor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 9abc9ee78..94faa713b 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -89,8 +89,7 @@ void CS::Editor::setupDataFiles() dataDirs.insert (dataDirs.end(), dataLocal.begin(), dataLocal.end()); -// Adding Resources directory. First check if there is a file defaultfilters in the user path. - mDocumentManager.setResourceDir(variables["resources"].as()); + mDocumentManager.setResourceDir(mCfgMgr.getGlobalDataPath()); for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter) { From 5e1bdd605b37e808e4785074cc675c9f8ca680d6 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Mon, 21 Oct 2013 18:15:26 +0200 Subject: [PATCH 12/14] Corrected formatting in document.hpp --- apps/opencs/model/doc/document.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/doc/document.hpp b/apps/opencs/model/doc/document.hpp index e6d1b0c87..fb929cca6 100644 --- a/apps/opencs/model/doc/document.hpp +++ b/apps/opencs/model/doc/document.hpp @@ -43,7 +43,7 @@ namespace CSMDoc CSMTools::Tools mTools; boost::filesystem::path mProjectPath; Saving mSaving; - boost::filesystem::path mResDir; + boost::filesystem::path mResDir; // It is important that the undo stack is declared last, because on desctruction it fires a signal, that is connected to a slot, that is // using other member variables. Unfortunately this connection is cut only in the QObject destructor, which is way too late. @@ -119,3 +119,4 @@ namespace CSMDoc } #endif + From 70602c2c36b74164112f2b5118ac620b08488db5 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Mon, 21 Oct 2013 18:24:16 +0200 Subject: [PATCH 13/14] Removed changes in the unimplemented copy ctor. --- apps/opencs/model/doc/document.cpp | 2 +- apps/opencs/model/doc/document.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index fd2b32861..b56460a03 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -2182,7 +2182,7 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, co else { boost::filesystem::path locCustomFiltersPath (configuration.getUserPath()); - locCustomFiltersPath /= "customfilters.omwaddon.project"; + locCustomFiltersPath /= "defaultfilters"; if (boost::filesystem::exists(locCustomFiltersPath)) { boost::filesystem::copy(locCustomFiltersPath, mProjectPath); diff --git a/apps/opencs/model/doc/document.hpp b/apps/opencs/model/doc/document.hpp index fb929cca6..437b0c513 100644 --- a/apps/opencs/model/doc/document.hpp +++ b/apps/opencs/model/doc/document.hpp @@ -50,7 +50,7 @@ namespace CSMDoc QUndoStack mUndoStack; // not implemented - Document (const Files::ConfigurationManager& configuration, const std::vector< boost::filesystem::path >& files, const boost::filesystem::path& savePath, bool new_); + Document (const Document&); Document& operator= (const Document&); void load (const std::vector::const_iterator& begin, From ce2c5582573118e19677690e2738d1913306db5d Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Mon, 21 Oct 2013 18:40:20 +0200 Subject: [PATCH 14/14] Missed a file. --- files/opencs/defaultfilters | Bin 0 -> 10958 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 files/opencs/defaultfilters diff --git a/files/opencs/defaultfilters b/files/opencs/defaultfilters new file mode 100644 index 0000000000000000000000000000000000000000..0ac3c8db4bd939b8b9d559ab4af4056fc0b8d80e GIT binary patch literal 10958 zcmeHN%Woq|8K1rKelD=EP-|WeWJm14g%PlFGMPzGW;VoO2Ux9E<#yR_((bmp+sOoh z7~Vo0RveI!K)?k!z=a!s04M$`zDIr4Rn=`fBj<=Oj=R75e!u!&RrOWQ4u)U;%5%5e z=kVa(=`Q@9O#b$&d-(r9)>`2H(ec@LJ&8wyhX?P6-;1*N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