From f07dc09dda17eced4dd9feba82f646fb3bd10069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96nnerby?= Date: Tue, 9 Dec 2008 12:38:04 +0000 Subject: [PATCH] Applied techtonik patches for typos (issue 78) and installer fix (issue 77). Thanks techtonik! --- installer/mc2_installer.nsi | 13 ++++++++++--- src/core/Library/LocalDB.cpp | 2 +- src/core/Library/Remote.cpp | 2 +- src/core/Query/Base.cpp | 12 ++++++------ src/core/Query/Base.h | 4 ++-- src/core/Query/ListBase.cpp | 10 +++++----- src/core/Query/ListBase.h | 4 ++-- src/core/Query/ListSelection.cpp | 8 ++++---- src/core/Query/ListSelection.h | 2 +- src/core/Query/SortTracks.cpp | 8 ++++---- src/core/Query/SortTracks.h | 2 +- src/core/Query/SortTracksWithData.cpp | 12 ++++++------ src/core/Query/SortTracksWithData.h | 6 +++--- src/core/Query/TrackMetadata.cpp | 6 +++--- src/core/Query/TrackMetadata.h | 4 ++-- src/core/server/Connection.cpp | 2 +- src/core/tracklist/Base.h | 12 ++++++------ src/core/tracklist/LibraryList.cpp | 8 ++++---- 18 files changed, 62 insertions(+), 55 deletions(-) diff --git a/installer/mc2_installer.nsi b/installer/mc2_installer.nsi index 8e873bbd5..ae6834bd8 100644 --- a/installer/mc2_installer.nsi +++ b/installer/mc2_installer.nsi @@ -1,6 +1,8 @@ SetCompressor /SOLID lzma !include "MUI.nsh" +!include "FileFunc.nsh" +!insertmacro DirState !define TRUE 1 @@ -14,6 +16,8 @@ SetCompressor /SOLID lzma !define INSTALL_DIR "musikCube 2" ;---------------------------------------------------------------- +!define MC2_DB_DIR "$APPDATA\mC2" + OutFile ".\${INSTALLER_NAME}.exe" Name "${PROJECT_NAME} ${SUB_NAME}" @@ -31,8 +35,8 @@ InstallDirRegKey HKCU "Software\${INSTALL_DIR}" "" ; Installation pages order !insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt" !insertmacro MUI_PAGE_DIRECTORY -;!insertmacro MUI_PAGE_COMPONENTS Page custom RemoveOldFilesPage RemoveOldFilesLeave ;Custom page +;!insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_INSTFILES @@ -59,7 +63,7 @@ Section "mC2installation" main IntCmpU $RemoveOldDatabases 0 DoNotRemoveDBFiles ; Remove the app data - RMDir /r $APPDATA\mC2 + RMDir /r "${MC2_DB_DIR}" DoNotRemoveDBFiles: @@ -87,8 +91,11 @@ Function .onInit FunctionEnd Function RemoveOldFilesPage + ${DirState} "${MC2_DB_DIR}" $0 + IntCmp $0 -1 0 +2 +2 + Abort !insertmacro MUI_HEADER_TEXT "mC2 installation" "Removing old database files" - !insertmacro MUI_INSTALLOPTIONS_WRITE "remove_old_db.ini" "Field 2" "Text" "Remove old mC2 databases in $APPDATA\mC2" + !insertmacro MUI_INSTALLOPTIONS_WRITE "remove_old_db.ini" "Field 2" "Text" "Remove old mC2 databases in ${MC2_DB_DIR}" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "remove_old_db.ini" FunctionEnd diff --git a/src/core/Library/LocalDB.cpp b/src/core/Library/LocalDB.cpp index 4ba864847..cd2f50964 100644 --- a/src/core/Library/LocalDB.cpp +++ b/src/core/Library/LocalDB.cpp @@ -105,7 +105,7 @@ utfstring Library::LocalDB::GetInfo(){ /// musik::core::Library::LocalDB library; /// // Start the library (and indexer that is included) /// library.Startup(); -/// // The library is now ready to recieve queries +/// // The library is now ready to receive queries ///\endcode ////////////////////////////////////////// bool Library::LocalDB::Startup(){ diff --git a/src/core/Library/Remote.cpp b/src/core/Library/Remote.cpp index d164fe08a..1ddf0e7ed 100644 --- a/src/core/Library/Remote.cpp +++ b/src/core/Library/Remote.cpp @@ -203,7 +203,7 @@ void Library::Remote::ReadThread(){ } } if(currentQuery){ - if(currentQuery->RecieveResults(node,this)){ + if(currentQuery->ReceiveResults(node,this)){ boost::mutex::scoped_lock lock(this->libraryMutex); currentQuery->status |= Query::Base::Status::Ended; }else{ diff --git a/src/core/Query/Base.cpp b/src/core/Query/Base.cpp index 2571ce4d0..4ca7b5862 100644 --- a/src/core/Query/Base.cpp +++ b/src/core/Query/Base.cpp @@ -61,15 +61,15 @@ Query::Base::~Base(void){ ////////////////////////////////////////// ///\brief -///Recieve the query from XML +///Receive the query from XML /// ///\param queryNode ///Reference to query XML node /// ///\returns -///true when successfully recieved +///true when successfully received ////////////////////////////////////////// -bool Query::Base::RecieveQuery(musik::core::xml::ParserNode &queryNode){ +bool Query::Base::ReceiveQuery(musik::core::xml::ParserNode &queryNode){ return false; } @@ -89,15 +89,15 @@ bool Query::Base::SendQuery(musik::core::xml::WriterNode &queryNode){ ////////////////////////////////////////// ///\brief -///Recieve results from XML +///Receive results from XML /// ///\param queryNode ///Reference to query XML node /// ///\returns -///true when successfully recieved +///true when successfully received ////////////////////////////////////////// -bool Query::Base::RecieveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library){ +bool Query::Base::ReceiveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library){ return false; } diff --git a/src/core/Query/Base.h b/src/core/Query/Base.h index e607e9c37..3b8edff75 100644 --- a/src/core/Query/Base.h +++ b/src/core/Query/Base.h @@ -202,9 +202,9 @@ class Base : public sigslot::has_slots<> { virtual void PreAddQuery(Library::Base *library){}; - virtual bool RecieveQuery(musik::core::xml::ParserNode &queryNode); + virtual bool ReceiveQuery(musik::core::xml::ParserNode &queryNode); virtual bool SendQuery(musik::core::xml::WriterNode &queryNode); - virtual bool RecieveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library); + virtual bool ReceiveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library); virtual bool SendResults(musik::core::xml::WriterNode &queryNode,Library::Base *library); public: diff --git a/src/core/Query/ListBase.cpp b/src/core/Query/ListBase.cpp index 0cbc50f10..3af029ea9 100644 --- a/src/core/Query/ListBase.cpp +++ b/src/core/Query/ListBase.cpp @@ -283,10 +283,10 @@ bool Query::ListBase::SendResults(musik::core::xml::WriterNode &queryNode,Librar return true; } -bool Query::ListBase::RecieveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library){ +bool Query::ListBase::ReceiveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library){ while( musik::core::xml::ParserNode node = queryNode.ChildNode() ){ - // Recieve metadata + // Receive metadata if( node.Name()=="metadata"){ std::string metakey(node.Attributes()["key"]); @@ -329,7 +329,7 @@ bool Query::ListBase::RecieveResults(musik::core::xml::ParserNode &queryNode,Lib typedef std::vector StringVector; - // Recieve tracks + // Receive tracks if( node.Name()=="tracklist"){ while( musik::core::xml::ParserNode tracksNode = node.ChildNode("tracks") ){ tracksNode.WaitForContent(); @@ -359,7 +359,7 @@ bool Query::ListBase::RecieveResults(musik::core::xml::ParserNode &queryNode,Lib } - // Recieve trackinfo + // Receive trackinfo if( node.Name()=="trackinfo"){ node.WaitForContent(); @@ -394,7 +394,7 @@ void Query::ListBase::DummySlotTrackInfo(UINT64,UINT64,UINT64){ } -bool Query::ListBase::RecieveQueryStandardNodes(musik::core::xml::ParserNode &node){ +bool Query::ListBase::ReceiveQueryStandardNodes(musik::core::xml::ParserNode &node){ if(node.Name()=="listeners"){ // Wait for all content diff --git a/src/core/Query/ListBase.h b/src/core/Query/ListBase.h index c9c17b859..b5a98504c 100644 --- a/src/core/Query/ListBase.h +++ b/src/core/Query/ListBase.h @@ -74,7 +74,7 @@ namespace musik{ namespace core{ bool ParseTracksSQL(std::string sql,Library::Base *library,db::Connection &db); - bool RecieveQueryStandardNodes(musik::core::xml::ParserNode &node); + bool ReceiveQueryStandardNodes(musik::core::xml::ParserNode &node); bool SendQueryStandardNodes(musik::core::xml::WriterNode &queryNode); MetadataResults metadataResults; @@ -92,7 +92,7 @@ namespace musik{ namespace core{ UINT64 trackInfoSize; virtual bool SendResults(musik::core::xml::WriterNode &queryNode,Library::Base *library); - virtual bool RecieveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library); + virtual bool ReceiveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library); public: MetadataSignal& OnMetadataEvent(const char* metatag); diff --git a/src/core/Query/ListSelection.cpp b/src/core/Query/ListSelection.cpp index 7b57ee2fb..a51ccfe3b 100644 --- a/src/core/Query/ListSelection.cpp +++ b/src/core/Query/ListSelection.cpp @@ -552,7 +552,7 @@ void Query::ListSelection::QueryForMetadata(const char *metakey,const char *sql, ////////////////////////////////////////// ///\brief -///Recieve the query from XML +///Receive the query from XML /// ///\param queryNode ///Reference to query XML node @@ -569,9 +569,9 @@ void Query::ListSelection::QueryForMetadata(const char *metakey,const char *sql, ///\endcode /// ///\returns -///true when successfully recieved +///true when successfully received ////////////////////////////////////////// -bool Query::ListSelection::RecieveQuery(musik::core::xml::ParserNode &queryNode){ +bool Query::ListSelection::ReceiveQuery(musik::core::xml::ParserNode &queryNode){ while( musik::core::xml::ParserNode node = queryNode.ChildNode() ){ if(node.Name()=="selections"){ @@ -595,7 +595,7 @@ bool Query::ListSelection::RecieveQuery(musik::core::xml::ParserNode &queryNode) } }else{ - this->RecieveQueryStandardNodes(node); + this->ReceiveQueryStandardNodes(node); } } return true; diff --git a/src/core/Query/ListSelection.h b/src/core/Query/ListSelection.h index 176468757..dba147cc9 100644 --- a/src/core/Query/ListSelection.h +++ b/src/core/Query/ListSelection.h @@ -85,7 +85,7 @@ class ListSelection : public Query::ListBase{ Ptr copy() const; - virtual bool RecieveQuery(musik::core::xml::ParserNode &queryNode); + virtual bool ReceiveQuery(musik::core::xml::ParserNode &queryNode); virtual bool SendQuery(musik::core::xml::WriterNode &queryNode); private: diff --git a/src/core/Query/SortTracks.cpp b/src/core/Query/SortTracks.cpp index d500dd366..0740f2255 100644 --- a/src/core/Query/SortTracks.cpp +++ b/src/core/Query/SortTracks.cpp @@ -214,7 +214,7 @@ void Query::SortTracks::ClearTracks(){ ////////////////////////////////////////// ///\brief -///Recieve the query from XML +///Receive the query from XML /// ///\param queryNode ///Reference to query XML node @@ -227,9 +227,9 @@ void Query::SortTracks::ClearTracks(){ ///\endcode /// ///\returns -///true when successfully recieved +///true when successfully received ////////////////////////////////////////// -bool Query::SortTracks::RecieveQuery(musik::core::xml::ParserNode &queryNode){ +bool Query::SortTracks::ReceiveQuery(musik::core::xml::ParserNode &queryNode){ while( musik::core::xml::ParserNode node = queryNode.ChildNode() ){ if(node.Name()=="sortby"){ @@ -259,7 +259,7 @@ bool Query::SortTracks::RecieveQuery(musik::core::xml::ParserNode &queryNode){ } }else{ - this->RecieveQueryStandardNodes(node); + this->ReceiveQueryStandardNodes(node); } } return true; diff --git a/src/core/Query/SortTracks.h b/src/core/Query/SortTracks.h index f201f4a79..966562966 100644 --- a/src/core/Query/SortTracks.h +++ b/src/core/Query/SortTracks.h @@ -82,7 +82,7 @@ namespace musik{ namespace core{ virtual std::string Name(); virtual bool ParseQuery(Library::Base *library,db::Connection &db); - virtual bool RecieveQuery(musik::core::xml::ParserNode &queryNode); + virtual bool ReceiveQuery(musik::core::xml::ParserNode &queryNode); virtual bool SendQuery(musik::core::xml::WriterNode &queryNode); private: diff --git a/src/core/Query/SortTracksWithData.cpp b/src/core/Query/SortTracksWithData.cpp index e565a64f6..ef12e3fec 100644 --- a/src/core/Query/SortTracksWithData.cpp +++ b/src/core/Query/SortTracksWithData.cpp @@ -213,7 +213,7 @@ void Query::SortTracksWithData::ClearTracks(){ ////////////////////////////////////////// ///\brief -///Recieve the query from XML +///Receive the query from XML /// ///\param queryNode ///Reference to query XML node @@ -226,9 +226,9 @@ void Query::SortTracksWithData::ClearTracks(){ ///\endcode /// ///\returns -///true when successfully recieved +///true when successfully received ////////////////////////////////////////// -bool Query::SortTracksWithData::RecieveQuery(musik::core::xml::ParserNode &queryNode){ +bool Query::SortTracksWithData::ReceiveQuery(musik::core::xml::ParserNode &queryNode){ while( musik::core::xml::ParserNode node = queryNode.ChildNode() ){ if(node.Name()=="sortby"){ @@ -393,14 +393,14 @@ bool Query::SortTracksWithData::SendResults(musik::core::xml::WriterNode &queryN ////////////////////////////////////////// ///\brief -///Recieve results from the musikServer. +///Receive results from the musikServer. ////////////////////////////////////////// -bool Query::SortTracksWithData::RecieveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library){ +bool Query::SortTracksWithData::ReceiveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library){ while( musik::core::xml::ParserNode node = queryNode.ChildNode() ){ typedef std::vector StringVector; - // Recieve tracks + // Receive tracks if( node.Name()=="tracklist"){ while( musik::core::xml::ParserNode trackNode = node.ChildNode("t") ){ trackNode.WaitForContent(); diff --git a/src/core/Query/SortTracksWithData.h b/src/core/Query/SortTracksWithData.h index 5ef2831c8..b126f6a6e 100644 --- a/src/core/Query/SortTracksWithData.h +++ b/src/core/Query/SortTracksWithData.h @@ -52,7 +52,7 @@ namespace musik{ namespace core{ namespace Query{ ////////////////////////////////////////// ///\brief -///SortTracksWithData is a query used to recieve sorted tracklists along with the data the tracks are sorted by +///SortTracksWithData is a query used to receive sorted tracklists along with the data the tracks are sorted by /// ///\remarks ///First concider to use the SortTracks query instead. @@ -102,10 +102,10 @@ class SortTracksWithData : public Query::Base{ virtual std::string Name(); virtual bool ParseQuery(Library::Base *library,db::Connection &db); - virtual bool RecieveQuery(musik::core::xml::ParserNode &queryNode); + virtual bool ReceiveQuery(musik::core::xml::ParserNode &queryNode); virtual bool SendQuery(musik::core::xml::WriterNode &queryNode); virtual bool SendResults(musik::core::xml::WriterNode &queryNode,Library::Base *library); - virtual bool RecieveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library); + virtual bool ReceiveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library); bool RunCallbacks(Library::Base *library); private: diff --git a/src/core/Query/TrackMetadata.cpp b/src/core/Query/TrackMetadata.cpp index bb1d0f5ec..fd0c2cc51 100644 --- a/src/core/Query/TrackMetadata.cpp +++ b/src/core/Query/TrackMetadata.cpp @@ -306,7 +306,7 @@ std::string TrackMetadata::Name(){ } -bool TrackMetadata::RecieveQuery(musik::core::xml::ParserNode &queryNode){ +bool TrackMetadata::ReceiveQuery(musik::core::xml::ParserNode &queryNode){ while(musik::core::xml::ParserNode metakeysNode = queryNode.ChildNode()){ if(metakeysNode.Name()=="metakeys"){ @@ -398,7 +398,7 @@ bool TrackMetadata::SendResults(musik::core::xml::WriterNode &queryNode,Library: if( !resultCopy.empty() ){ try{ for(TrackVector::iterator track=resultCopy.begin();track!=resultCopy.end();++track){ - // Erase the path.. is translated in the RecieveResults + // Erase the path.. is translated in the ReceiveResults (*track)->ClearValue("path"); musik::core::xml::WriterNode trackNode(queryNode,"t"); @@ -429,7 +429,7 @@ bool TrackMetadata::SendResults(musik::core::xml::WriterNode &queryNode,Library: } -bool TrackMetadata::RecieveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library){ +bool TrackMetadata::ReceiveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library){ bool requestPath( this->requestedFields.find("path")!=this->requestedFields.end() ); utfstring pathPrefix(library->BasePath()+UTF("track/?auth_key=")); diff --git a/src/core/Query/TrackMetadata.h b/src/core/Query/TrackMetadata.h index d5a64b8f0..0d8cbfc56 100644 --- a/src/core/Query/TrackMetadata.h +++ b/src/core/Query/TrackMetadata.h @@ -96,10 +96,10 @@ class TrackMetadata : public Query::Base { virtual bool ParseQuery(Library::Base *library,db::Connection &db); virtual std::string Name(); - virtual bool RecieveQuery(musik::core::xml::ParserNode &queryNode); + virtual bool ReceiveQuery(musik::core::xml::ParserNode &queryNode); virtual bool SendQuery(musik::core::xml::WriterNode &queryNode); virtual bool SendResults(musik::core::xml::WriterNode &queryNode,Library::Base *library); - virtual bool RecieveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library); + virtual bool ReceiveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library); }; diff --git a/src/core/server/Connection.cpp b/src/core/server/Connection.cpp index 4c4ff5abf..30d1c15c4 100644 --- a/src/core/server/Connection.cpp +++ b/src/core/server/Connection.cpp @@ -152,7 +152,7 @@ void Connection::ReadThread(){ query->uniqueId = boost::lexical_cast(queryNode.Attributes()["uid"]); }catch(...){} - if(query->RecieveQuery(queryNode)){ + if(query->ReceiveQuery(queryNode)){ unsigned int options(0); try{ diff --git a/src/core/tracklist/Base.h b/src/core/tracklist/Base.h index c571f546e..54e36f358 100644 --- a/src/core/tracklist/Base.h +++ b/src/core/tracklist/Base.h @@ -191,7 +191,7 @@ class Base : boost::noncopyable{ ////////////////////////////////////////// ///\brief - ///Connect the tracklist to recieve tracks from a ListBase query. + ///Connect the tracklist to receive tracks from a ListBase query. ////////////////////////////////////////// virtual bool ConnectToQuery(musik::core::Query::ListBase &query); @@ -225,9 +225,9 @@ class Base : boost::noncopyable{ typedef sigslot::signal1> TrackMetadataEvent; ////////////////////////////////////////// ///\brief - ///Event, called when metadata has been recieved. + ///Event, called when metadata has been received. /// - ///The event reciever will get a std::vector& with + ///The event receiver will get a std::vector& with ///a vector of positions of tracks that has been updated. ////////////////////////////////////////// TrackMetadataEvent TrackMetadataUpdated; @@ -239,7 +239,7 @@ class Base : boost::noncopyable{ ///\brief ///Event, called when summary has been updated /// - ///The event reciever will get 3 UINT64 parameters + ///The event receiver will get 3 UINT64 parameters ////////////////////////////////////////// SummaryInfoEvent SummaryInfoUpdated; @@ -250,7 +250,7 @@ class Base : boost::noncopyable{ ///\brief ///Event, called when tracks inside the tracklist has been added/changed /// - ///The event reciever will get a bool set to true if the list has been cleared first + ///The event receiver will get a bool set to true if the list has been cleared first ////////////////////////////////////////// TracklistChangedEvent TracklistChanged; @@ -261,7 +261,7 @@ class Base : boost::noncopyable{ ///\brief ///Event, called when position in tracklist has been updated /// - ///The event reciever will get the nex position, and the old position + ///The event receiver will get the nex position, and the old position ////////////////////////////////////////// PositionChangedEvent PositionChanged; diff --git a/src/core/tracklist/LibraryList.cpp b/src/core/tracklist/LibraryList.cpp index 078f30d7e..199c7af32 100644 --- a/src/core/tracklist/LibraryList.cpp +++ b/src/core/tracklist/LibraryList.cpp @@ -388,7 +388,7 @@ bool LibraryList::QueryForTrack(long position){ ////////////////////////////////////////// ///\brief -///Connect to recieve results from any query based on the musik::core::Query::ListBase +///Connect to receive results from any query based on the musik::core::Query::ListBase ////////////////////////////////////////// bool LibraryList::ConnectToQuery(musik::core::Query::ListBase &query){ query.OnTrackEvent().connect(this,&LibraryList::OnTracksFromQuery); @@ -399,7 +399,7 @@ bool LibraryList::ConnectToQuery(musik::core::Query::ListBase &query){ ////////////////////////////////////////// ///\brief -///Recieve new tracks from a query +///Receive new tracks from a query /// ///\param newTracks ///The new tracks @@ -426,7 +426,7 @@ void LibraryList::OnTracksFromQuery(musik::core::TrackVector *newTracks,bool cle ////////////////////////////////////////// ///\brief -///Called by connected queries to recieve summary from tracklist +///Called by connected queries to receive summary from tracklist ////////////////////////////////////////// void LibraryList::OnTracksSummaryFromQuery(UINT64 tracks,UINT64 duration,UINT64 filesize){ this->SummaryInfoUpdated(tracks,duration,filesize); @@ -435,7 +435,7 @@ void LibraryList::OnTracksSummaryFromQuery(UINT64 tracks,UINT64 duration,UINT64 ////////////////////////////////////////// ///\brief -///Recieves what tracks now have metadata, and pass them forward to the TrackMetadataUpdated signal +///Receives what tracks now have metadata, and pass them forward to the TrackMetadataUpdated signal ////////////////////////////////////////// void LibraryList::OnTracksMetaFromQuery(musik::core::TrackVector *metaTracks){ std::vector updateTrackPositions;