diff --git a/HACKING.txt b/HACKING.txt index dada1901..a410ec3a 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -19,25 +19,24 @@ TABLE OF CONTENTS Coding style ============ -To understand how things work, read doc/svn-design.{texi,info,ps,pdf}, -and read the header files, which tend to have thoroughly-commented -data structures. +To understand how things work, read the header and source files, +which tend to have thoroughly-commented data structures. char * // func type on own line - argblarg (char *arg1, int arg2) // func name on own line, single - // space between function name + argblarg(char *arg1, int arg2) // func name on own line, no + // space between function name // and opening paren - { // first brace on own line + { // first brace on own line if ((some_very_long_condition && arg2) // indent 2 cols (no tabs!) || remaining_condition) // new line before operator - { // brace on own line - arg1 = some_func (arg1, arg2); // space before opening paren + { // brace on own line + arg1 = some_func(arg1, arg2); // no space before opening paren } // close brace on own line else { do // format do-while like this { - arg1 = another_func (arg1); + arg1 = another_func(arg1); } while (*arg1); } @@ -69,7 +68,7 @@ class Foo { int m_myMember; - Foo (int intitialFoo) + Foo(int intitialFoo) { int bar = initialFoo * 2; @@ -82,8 +81,8 @@ class Foo Documenting =================== -Every function and class, whether public or internal, must start -out with a documentation comment that describes what the function +Every function and class, whether public or internal, must start +out with a documentation comment that describes what the function does. The comments are placed in the headers. Comments in the source files are only used for implementation details. @@ -100,7 +99,7 @@ Example: * @return the multiplied number */ int -MultiplyMe (int number1, int number2); +MultiplyMe(int number1, int number2); Read over the RapidSVN code to get an overview of how this documentation looks in practice. @@ -141,11 +140,11 @@ Later on, when someone is trying to figure out what happened to `twirling_baton_fast', they may not find it if they just search for "_fast". A better entry would be: - * twirl.cpp + * twirl.cpp (twirling_baton_fast, twirling_baton_slow): Removed these - obsolete structures. + obsolete structures. (handle_parser_warning): Pass data directly to callees, instead - of storing in twirling_baton_*. + of storing in twirling_baton_*. * twirl.h: Fix indentation. @@ -160,11 +159,11 @@ adhere to this format -- not only does consistency aid readability, it also allows software to colorize log entries automatically. If your change is related to a specific issue in the issue tracker, -then include a string like "issue #N" in the log message. For +then include a string like "Issue N" in the log message. For example, if a patch resolves issue 1729, then the log message might be: - Fix issue #1729: + Issue 1729: Program crashes if file doesnt exist * get_editor.cpp (frobnicate_file): Check that file exists first. @@ -186,7 +185,7 @@ it right: And then, in `consume_count' in `cplus-dem.cpp': - while (isdigit ((unsigned char)**type)) + while (isdigit((unsigned char)**type)) { count *= 10; count += **type - '0'; @@ -242,19 +241,19 @@ In addition to the standards above, RapidSVN uses these conventions: * Stay within 80 columns, the width of a minimal standard display window. - - * If you add any files to the project that might be opened on more - than one operating system then give the file the native eol-style - property. This ensures that all files downloaded via svn - arrive with the line endings native to that OS. Here is how you + + * If you add any files to the project that might be opened on more + than one operating system then give the file the native eol-style + property. This ensures that all files downloaded via svn + arrive with the line endings native to that OS. Here is how you add the property: % svn propset eol-style native new_file.cpp * If you add images to the project make sure you apply the correct - mime-type property. + mime-type property. Example for a XPM: % svn propset svn:mime-type image/x-xpm - + Maintainer's Corner @@ -265,19 +264,19 @@ For the RapidSVN website we are producing two types of packages: * Source tarball rapidsvn-???.tar.gz * Windows Installer RapidSVN-???.exe - + These are the steps to follow when creating a new release of RapidSVN: 0. Before Release: - * Check the translations (in src/locale). - * Make sure all the strings for all the translations are + * Check the translations (in src/locale). + * Make sure all the strings for all the translations are up to date (contact translators) 1. Release preparations: - * Edit the version numbers in the file "version.xml" and run + * Edit the version numbers in the file "version.xml" and run the Python script check-version.py (from the directory "tools") * Create the the change description in the "CHANGES" file @@ -304,7 +303,7 @@ These are the steps to follow when creating a new release of RapidSVN: * Extract the source tarball to a temporary directory, check if everything is there and call "configure", "make", "make install" - * Run RapidSVN + * Run RapidSVN * Send the tarball to xelarellum@tigris.org, so he can upload it to http://www.rapidsvn.org/download and create the necessary links in @@ -315,7 +314,7 @@ These are the steps to follow when creating a new release of RapidSVN: * Checkout a fresh working copy of RapidSVN (using http://rapidsvn.tigris.org/svn/rapidsvn/tags/XYZ) from the repository to make sure everything is built and no old stuff is lying around - + * Make sure you are using the latest stable release of Innosetup, Subversion, wxWidgets, Openssl, BerkeyleyDB. Build all these tools and libraries. Some minor changes in apr_config.h or apu_config.h may @@ -341,18 +340,18 @@ These are the steps to follow when creating a new release of RapidSVN: * Run RapidSVN - * Send the installer executable to xelarellum@tigris.org, so he can - upload it to http://www.rapidsvn.org/download and create - the necessary links in the files/documents section of + * Send the installer executable to xelarellum@tigris.org, so he can + upload it to http://www.rapidsvn.org/download and create + the necessary links in the files/documents section of http://rapidsvn.tigris.org 3. Create a news entry on http://rapidsvn.tigris.org and send announcement emails (with same text) to announce@rapidsvn.tigris.org, dev@rapidsvn.tigris.org, - users@rapidsvn.tigris.org including the MD5 checksums for both the + users@rapidsvn.tigris.org including the MD5 checksums for both the source tarball and the win32 installer executable. -4. Update and commit (with CVS) the webpage http://rapidsvn.tigris.org. - This includes changes to the roadmap items, archival of older roadmap items, +4. Update and commit (with CVS) the webpage http://rapidsvn.tigris.org. + This includes changes to the roadmap items, archival of older roadmap items, updating of the svncpp doxygen documentation (you can use the output generated when building on Linux). diff --git a/include/svncpp/annotate_line.hpp b/include/svncpp/annotate_line.hpp index 3940d879..db35ac5a 100644 --- a/include/svncpp/annotate_line.hpp +++ b/include/svncpp/annotate_line.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,58 +36,58 @@ namespace svn class AnnotateLine { public: - AnnotateLine (apr_int64_t line_no, - svn_revnum_t revision, - const char *author, - const char *date, - const char *line) - : m_line_no (line_no), m_revision (revision), - m_author (author), m_date (date), m_line (line) + AnnotateLine(apr_int64_t line_no, + svn_revnum_t revision, + const char *author, + const char *date, + const char *line) + : m_line_no(line_no), m_revision(revision), + m_author(author), m_date(date), m_line(line) { } - AnnotateLine ( const AnnotateLine &other) - : m_line_no (other.m_line_no), m_revision (other.m_revision), - m_author (other.m_author), m_date (other.m_date), - m_line (other.m_line) + AnnotateLine(const AnnotateLine &other) + : m_line_no(other.m_line_no), m_revision(other.m_revision), + m_author(other.m_author), m_date(other.m_date), + m_line(other.m_line) { } /** - * destructor + * destructor */ - virtual ~AnnotateLine () + virtual ~AnnotateLine() { } - apr_int64_t - lineNumber () const + apr_int64_t + lineNumber() const { return m_line_no; } - svn_revnum_t - revision () const + svn_revnum_t + revision() const { return m_revision; } const std::string & - author () const + author() const { return m_author; } const std::string & - date () const + date() const { return m_date; } const std::string & - line () const + line() const { return m_line; } diff --git a/include/svncpp/apr.hpp b/include/svncpp/apr.hpp index 478f8179..c361365a 100644 --- a/include/svncpp/apr.hpp +++ b/include/svncpp/apr.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -41,16 +41,16 @@ namespace svn /** * Default constructor. Initializes APR */ - Apr (); + Apr(); /** * Destructor. Terminates APR */ - ~Apr (); + ~Apr(); private: /** Disallow copy constructor */ - Apr (const Apr &); + Apr(const Apr &); /** Disallow assignment operator */ Apr & diff --git a/include/svncpp/client.hpp b/include/svncpp/client.hpp index bb57004c..384024cf 100644 --- a/include/svncpp/client.hpp +++ b/include/svncpp/client.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -86,10 +86,10 @@ namespace svn */ struct StatusFilter { - public: +public: bool showUnversioned; bool showUnmodified; - bool showModified; ///< this includes @a showConflicted as well + bool showModified; ///< this includes @a showConflicted as well bool showConflicted; bool showIgnored; bool showExternals; @@ -105,20 +105,20 @@ namespace svn /** * Initializes the primary memory pool. */ - Client (Context * context = 0); + Client(Context * context = 0); - virtual ~Client (); + virtual ~Client(); /** * @return returns the Client context */ - const Context * - getContext () const; + const Context * + getContext() const; /** * @return returns the Client context */ - Context * + Context * getContext(); /** @@ -128,8 +128,8 @@ namespace svn * * @param context new context to use */ - void - setContext (Context * context = NULL); + void + setContext(Context * context = NULL); /** * Enumerates all files/dirs at a given path. @@ -144,16 +144,16 @@ namespace svn * @param ignore_externals Disregard external files. * @return vector with Status entries. */ - StatusEntries - status (const char * path, - const bool descend = false, - const bool get_all = true, - const bool update = false, - const bool no_ignore = false, - const bool ignore_externals = false) throw (ClientException); + StatusEntries + status(const char * path, + const bool descend = false, + const bool get_all = true, + const bool update = false, + const bool no_ignore = false, + const bool ignore_externals = false) throw(ClientException); /** - * Enumerates all files/dirs matchin the parameter @a filter + * Enumerates all files/dirs matchin the parameter @a filter * at @a path and returns them in the vector @a statusEntries * * Throws an exception if an error occurs @@ -170,12 +170,12 @@ namespace svn * @return current revnum */ svn_revnum_t - status (const char * path, - const StatusFilter & filter, - const bool descend, - const bool update, - StatusEntries & entries) throw (ClientException); - + status(const char * path, + const StatusFilter & filter, + const bool descend, + const bool update, + StatusEntries & entries) throw(ClientException); + /** * Executes a revision checkout. @@ -189,27 +189,27 @@ namespace svn * @exception ClientException */ svn_revnum_t - checkout (const char * moduleName, - const Path & destPath, - const Revision & revision, - bool recurse, - bool ignore_externals = false, - const Revision & peg_revision = Revision::UNSPECIFIED) throw (ClientException); - + checkout(const char * moduleName, + const Path & destPath, + const Revision & revision, + bool recurse, + bool ignore_externals = false, + const Revision & peg_revision = Revision::UNSPECIFIED) throw(ClientException); + /** * relocate wc @a from to @a to * @exception ClientException */ - void - relocate (const Path & path, const char *from_url, - const char *to_url, bool recurse) throw (ClientException); + void + relocate(const Path & path, const char *from_url, + const char *to_url, bool recurse) throw(ClientException); /** * Sets a single file for deletion. * @exception ClientException */ - void - remove (const Path & path, bool force) throw (ClientException); + void + remove(const Path & path, bool force) throw(ClientException); /** * Sets files for deletion. @@ -218,9 +218,9 @@ namespace svn * @param force force if files are locally modified * @exception ClientException */ - void - remove (const Targets & targets, - bool force) throw (ClientException); + void + remove(const Targets & targets, + bool force) throw(ClientException); /** * Sets files to lock. @@ -230,9 +230,9 @@ namespace svn * @param comment writing comment about lock setting is neccessary * @exception ClientException */ - void - lock (const Targets & targets, bool force, - const char * comment) throw (ClientException); + void + lock(const Targets & targets, bool force, + const char * comment) throw(ClientException); /** * Sets files to unlock. @@ -241,28 +241,28 @@ namespace svn * @param force force unlock even if lock belongs to another user * @exception ClientException */ - void - unlock (const Targets & targets, bool force) throw (ClientException); + void + unlock(const Targets & targets, bool force) throw(ClientException); /** * Reverts a couple of files to a pristiner state. * @exception ClientException */ void - revert (const Targets & targets, bool recurse) throw (ClientException); + revert(const Targets & targets, bool recurse) throw(ClientException); /** * Adds a file to the repository. * @exception ClientException */ - void - add (const Path & path, bool recurse) throw (ClientException); + void + add(const Path & path, bool recurse) throw(ClientException); /** * Updates the file or directory. * @param targets target files. - * @param revision the revision number to checkout. - * Revision::HEAD will checkout the + * @param revision the revision number to checkout. + * Revision::HEAD will checkout the * latest revision. * @param recurse recursively update. * @param ignore_externals don't affect external destinations. @@ -271,16 +271,16 @@ namespace svn * @return a vector with resulting revisions */ std::vector - update (const Targets & targets, - const Revision & revision, - bool recurse, - bool ignore_externals) throw (ClientException); + update(const Targets & targets, + const Revision & revision, + bool recurse, + bool ignore_externals) throw(ClientException); svn_revnum_t - update (const Path & path, - const Revision & revision, - bool recurse, - bool ignore_externals) throw (ClientException); + update(const Path & path, + const Revision & revision, + bool recurse, + bool ignore_externals) throw(ClientException); /** * Retrieves the contents for a specific @a revision of @@ -288,14 +288,14 @@ namespace svn * * @param path path of file or directory * @param revision revision to retrieve - * @param peg_revision peg revision to retrieve, + * @param peg_revision peg revision to retrieve, * by default is the latest one * @return contents of the file */ std::string - cat (const Path & path, - const Revision & revision, - const Revision & peg_revision = Revision::UNSPECIFIED) throw (ClientException); + cat(const Path & path, + const Revision & revision, + const Revision & peg_revision = Revision::UNSPECIFIED) throw(ClientException); /** @@ -310,15 +310,15 @@ namespace svn * * @param dstPath Filename in which the contents * of the file file will be safed. - * @param path path or url + * @param path path or url * @param revision * @param peg_revision peg revision to retrieve, by default is the latest one */ void - get (Path & dstPath, - const Path & path, - const Revision & revision, - const Revision & peg_revision = Revision::UNSPECIFIED) throw (ClientException); + get(Path & dstPath, + const Path & path, + const Revision & revision, + const Revision & peg_revision = Revision::UNSPECIFIED) throw(ClientException); /** @@ -331,14 +331,14 @@ namespace svn * @return contents of the file */ AnnotatedFile * - annotate (const Path & path, - const Revision & revisionStart, - const Revision & revisionEnd) throw (ClientException); + annotate(const Path & path, + const Revision & revisionStart, + const Revision & revisionEnd) throw(ClientException); /** - * Commits changes to the repository. This usually requires + * Commits changes to the repository. This usually requires * authentication, see Auth. - * @return Returns a long representing the revision. It returns a + * @return Returns a long representing the revision. It returns a * -1 if the revision number is invalid. * @param targets files to commit. * @param message log message. @@ -347,43 +347,43 @@ namespace svn * @exception ClientException */ svn_revnum_t - commit (const Targets & targets, - const char * message, - bool recurse, - bool keep_locks = false) throw (ClientException); + commit(const Targets & targets, + const char * message, + bool recurse, + bool keep_locks = false) throw(ClientException); /** * Copies a versioned file with the history preserved. * @exception ClientException */ - void - copy (const Path & srcPath, - const Revision & srcRevision, - const Path & destPath) throw (ClientException); + void + copy(const Path & srcPath, + const Revision & srcRevision, + const Path & destPath) throw(ClientException); /** * Moves or renames a file. * @exception ClientException */ - void - move (const Path & srcPath, - const Revision & srcRevision, - const Path & destPath, - bool force) throw (ClientException); + void + move(const Path & srcPath, + const Revision & srcRevision, + const Path & destPath, + bool force) throw(ClientException); /** - * Creates a directory directly in a repository or creates a + * Creates a directory directly in a repository or creates a * directory on disk and schedules it for addition. If path * is a URL then authentication is usually required, see Auth. - * + * * @param path * @exception ClientException */ - void - mkdir (const Path & path) throw (ClientException); + void + mkdir(const Path & path) throw(ClientException); - void - mkdir (const Targets & targets) throw (ClientException); + void + mkdir(const Targets & targets) throw(ClientException); /** * Recursively cleans up a local directory, finishing any @@ -391,15 +391,15 @@ namespace svn * @param path a local directory. * @exception ClientException */ - void - cleanup (const Path & path) throw (ClientException); + void + cleanup(const Path & path) throw(ClientException); /** * Removes the 'conflicted' state on a file. * @exception ClientException */ - void - resolved (const Path & path, bool recurse) throw (ClientException); + void + resolved(const Path & path, bool recurse) throw(ClientException); /** * Export into file or directory TO_PATH from local or remote FROM_PATH @@ -415,24 +415,24 @@ namespace svn * @exception ClientException */ void - doExport (const Path & from_path, - const Path & to_path, - const Revision & revision, - bool overwrite = false, - const Revision & peg_revision = Revision::UNSPECIFIED, - bool ignore_externals = false, - bool recurse = true, - const char * native_eol = NULL) throw (ClientException); + doExport(const Path & from_path, + const Path & to_path, + const Revision & revision, + bool overwrite = false, + const Revision & peg_revision = Revision::UNSPECIFIED, + bool ignore_externals = false, + bool recurse = true, + const char * native_eol = NULL) throw(ClientException); /** - * Update local copy to mirror a new url. This excapsulates the + * Update local copy to mirror a new url. This excapsulates the * svn_client_switch() client method. * @exception ClientException */ svn_revnum_t - doSwitch (const Path & path, const char * url, - const Revision & revision, - bool recurse) throw (ClientException); + doSwitch(const Path & path, const char * url, + const Revision & revision, + bool recurse) throw(ClientException); /** * Import file or directory PATH into repository directory URL at @@ -443,29 +443,29 @@ namespace svn * @param recurse * @exception ClientException */ - void - import (const Path & path, - const char * url, - const char * message, - bool recurse) throw (ClientException); void - import (const Path & path, - const Path & url, - const char * message, - bool recurse) throw (ClientException); + import(const Path & path, + const char * url, + const char * message, + bool recurse) throw(ClientException); + void + import(const Path & path, + const Path & url, + const char * message, + bool recurse) throw(ClientException); /** * Merge changes from two paths into a new local path. * @exception ClientException */ - void - merge (const Path & path1, const Revision & revision1, - const Path & path2, const Revision & revision2, - const Path & localPath, bool force, - bool recurse, - bool notice_ancestry = false, - bool dry_run = false) throw (ClientException); + void + merge(const Path & path1, const Revision & revision1, + const Path & path2, const Revision & revision2, + const Path & localPath, bool force, + bool recurse, + bool notice_ancestry = false, + bool dry_run = false) throw(ClientException); /** @@ -481,10 +481,10 @@ namespace svn * @param recurse */ InfoVector - info (const Path & pathOrUrl, - bool recurse=false, - const Revision & revision = Revision::UNSPECIFIED, - const Revision & pegRevision = Revision::UNSPECIFIED) throw (ClientException); + info(const Path & pathOrUrl, + bool recurse=false, + const Revision & revision = Revision::UNSPECIFIED, + const Revision & pegRevision = Revision::UNSPECIFIED) throw(ClientException); /** @@ -503,11 +503,11 @@ namespace svn * @return a vector with log entries */ const LogEntries * - log (const char * path, - const Revision & revisionStart, - const Revision & revisionEnd, - bool discoverChangedPaths = false, - bool strictNodeHistory = true) throw (ClientException); + log(const char * path, + const Revision & revisionStart, + const Revision & revisionEnd, + bool discoverChangedPaths = false, + bool strictNodeHistory = true) throw(ClientException); /** * Produce diff output which describes the delta between @@ -532,10 +532,10 @@ namespace svn * @exception ClientException */ std::string - diff (const Path & tmpPath, const Path & path, - const Revision & revision1, const Revision & revision2, - const bool recurse, const bool ignoreAncestry, - const bool noDiffDeleted) throw (ClientException); + diff(const Path & tmpPath, const Path & path, + const Revision & revision1, const Revision & revision2, + const bool recurse, const bool ignoreAncestry, + const bool noDiffDeleted) throw(ClientException); /** * Produce diff output which describes the delta between @@ -561,14 +561,14 @@ namespace svn * @exception ClientException */ std::string - diff (const Path & tmpPath, const Path & path1, const Path & path2, - const Revision & revision1, const Revision & revision2, - const bool recurse, const bool ignoreAncestry, - const bool noDiffDeleted) throw (ClientException); + diff(const Path & tmpPath, const Path & path1, const Path & path2, + const Revision & revision1, const Revision & revision2, + const bool recurse, const bool ignoreAncestry, + const bool noDiffDeleted) throw(ClientException); /** * Produce diff output which describes the delta of - * @a path/@a pegRevision between @a revision1 and @a revision2. + * @a path/@a pegRevision between @a revision1 and @a revision2. * @a path can be either a working-copy path or a URL. * * A ClientException will be thrown if either @a revision1 or @@ -590,11 +590,11 @@ namespace svn * @exception ClientException */ std::string - diff (const Path & tmpPath, const Path & path, - const Revision & pegRevision, const Revision & revision1, - const Revision & revision2, const bool recurse, - const bool ignoreAncestry, const bool noDiffDeleted) - throw (ClientException); + diff(const Path & tmpPath, const Path & path, + const Revision & pegRevision, const Revision & revision1, + const Revision & revision2, const bool recurse, + const bool ignoreAncestry, const bool noDiffDeleted) + throw(ClientException); /** * lists entries in @a pathOrUrl no matter whether local or @@ -607,9 +607,9 @@ namespace svn * a relative path (only filename) */ DirEntries - list (const char * pathOrUrl, - svn_opt_revision_t * revision, - bool recurse) throw (ClientException); + list(const char * pathOrUrl, + svn_opt_revision_t * revision, + bool recurse) throw(ClientException); /** * lists properties in @a path no matter whether local or @@ -621,9 +621,9 @@ namespace svn * @return PropertiesList */ PathPropertiesMapList - proplist (const Path &path, - const Revision &revision, - bool recurse = false); + proplist(const Path &path, + const Revision &revision, + bool recurse = false); /** * lists one property in @a path no matter whether local or @@ -636,10 +636,10 @@ namespace svn * @return PathPropertiesMapList */ PathPropertiesMapList - propget (const char * propName, - const Path & path, - const Revision & revision, - bool recurse = false); + propget(const char * propName, + const Path & path, + const Revision & revision, + bool recurse = false); /** * This method is deprecated, please use @@ -658,12 +658,12 @@ namespace svn * @return PropertiesList */ void - propset (const char * propName, - const char * propValue, - const Path & path, - const Revision & revision, - bool recurse = false, - bool skip_checks = true); + propset(const char * propName, + const char * propValue, + const Path & path, + const Revision & revision, + bool recurse = false, + bool skip_checks = true); /** * delete property in @a path no matter whether local or @@ -675,10 +675,10 @@ namespace svn * @param recurse */ void - propdel (const char * propName, - const Path & path, - const Revision & revision, - bool recurse = false); + propdel(const char * propName, + const Path & path, + const Revision & revision, + bool recurse = false); /** @@ -690,8 +690,8 @@ namespace svn * @return PropertiesList */ std::pair - revproplist (const Path & path, - const Revision & revision); + revproplist(const Path & path, + const Revision & revision); /** * lists one revision property in @a path no matter whether local or @@ -703,9 +703,9 @@ namespace svn * @return PropertiesList */ std::pair - revpropget (const char * propName, - const Path & path, - const Revision & revision); + revpropget(const char * propName, + const Path & path, + const Revision & revision); /** * set revision property in @a path no matter whether local or @@ -719,11 +719,11 @@ namespace svn * @return Revision */ svn_revnum_t - revpropset (const char * propName, - const char * propValue, - const Path & path, - const Revision & revision, - bool force = false); + revpropset(const char * propName, + const char * propValue, + const Path & path, + const Revision & revision, + bool force = false); /** * delete revision property in @a path no matter whether local or @@ -736,31 +736,31 @@ namespace svn * @return Revision */ svn_revnum_t - revpropdel (const char * propName, - const Path & path, - const Revision & revision, - bool force = false); + revpropdel(const char * propName, + const Path & path, + const Revision & revision, + bool force = false); /** * Add a single file into ignore list. - * - * @param path path to the file + * + * @param path path to the file * @exception ClientException - * @see svn:ignore property description + * @see svn:ignore property description */ - void - ignore (const Path & path) throw (ClientException); + void + ignore(const Path & path) throw(ClientException); /** * Add files into ignore list. * - * @param targets targets to treat as ignored + * @param targets targets to treat as ignored * @exception ClientException - * @see svn:ignore property description + * @see svn:ignore property description */ - void - ignore (const Targets & targets) throw (ClientException); + void + ignore(const Targets & targets) throw(ClientException); private: Context * m_context; @@ -772,7 +772,7 @@ namespace svn /** * disallow copy constructor */ - Client (const Client &); + Client(const Client &); }; } diff --git a/include/svncpp/context.hpp b/include/svncpp/context.hpp index c846b74e..28d5a184 100644 --- a/include/svncpp/context.hpp +++ b/include/svncpp/context.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -23,7 +23,7 @@ */ #ifndef _SVNCPP_CONTEXT_HPP_ -#define _SVNCPP_CONTEXT_HPP_ +#define _SVNCPP_CONTEXT_HPP_ // stl #include "svncpp/string_wrapper.hpp" @@ -49,37 +49,37 @@ namespace svn { public: /** - * default constructor + * default constructor * * @param configDir location where the * subversion api stores its * configuration */ - Context (const std::string & configDir = ""); + Context(const std::string & configDir = ""); /** * copy constructor * - * @param src + * @param src */ - Context (const Context &src); + Context(const Context &src); /** * destructor */ - virtual ~Context (); + virtual ~Context(); /** * enable/disable authentication caching - * + * * @param value true=enable/false=disable */ - void setAuthCache (bool value); + void setAuthCache(bool value); /** * set username/password for authentication */ - void setLogin (const char * username, const char * password); + void setLogin(const char * username, const char * password); /** * operator to get svn_client_ctx object @@ -89,36 +89,36 @@ namespace svn /** * return the svn_client_ctx object */ - svn_client_ctx_t * ctx (); + svn_client_ctx_t * ctx(); /** * this will be called at the beginning of an action. * the log message will be reset. */ - void reset (); + void reset(); /** * set log message * * @param msg */ - void setLogMessage (const char * msg); + void setLogMessage(const char * msg); /** * get log message * * @return log message */ - const char * - getLogMessage () const; - + const char * + getLogMessage() const; + /** * get username * * @return username */ - const char * - getUsername () const; + const char * + getUsername() const; /** * get password @@ -126,7 +126,7 @@ namespace svn * @return password */ const char * - getPassword () const; + getPassword() const; /** * set the listener for the context. The listener will be @@ -135,16 +135,16 @@ namespace svn * * @param listener */ - void - setListener (ContextListener * listener); + void + setListener(ContextListener * listener); /** * get the listener * * @return the listener */ - ContextListener * - getListener () const; + ContextListener * + getListener() const; private: struct Data; diff --git a/include/svncpp/context_listener.hpp b/include/svncpp/context_listener.hpp index 14da8046..407d482d 100644 --- a/include/svncpp/context_listener.hpp +++ b/include/svncpp/context_listener.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -23,7 +23,7 @@ */ #ifndef _SVNCPP_CONTEXT_LISTENER_HPP_ -#define _SVNCPP_CONTEXT_LISTENER_HPP_ +#define _SVNCPP_CONTEXT_LISTENER_HPP_ // stl #include "svncpp/string_wrapper.hpp" @@ -49,7 +49,7 @@ namespace svn * this method will be called to retrieve * authentication information * - * WORKAROUND FOR apr_xlate PROBLEM: + * WORKAROUND FOR apr_xlate PROBLEM: * STRINGS ALREADY HAVE TO BE UTF8!!! * * @param username @@ -59,13 +59,13 @@ namespace svn * @return continue action? * @retval true continue */ - virtual bool - contextGetLogin (const std::string & realm, - std::string & username, - std::string & password, - bool & maySave) = 0; + virtual bool + contextGetLogin(const std::string & realm, + std::string & username, + std::string & password, + bool & maySave) = 0; - /** + /** * this method will be called to notify about * the progress of an ongoing action * @@ -78,13 +78,13 @@ namespace svn * @param revision */ virtual void - contextNotify (const char *path, - svn_wc_notify_action_t action, - svn_node_kind_t kind, - const char *mime_type, - svn_wc_notify_state_t content_state, - svn_wc_notify_state_t prop_state, - svn_revnum_t revision) = 0; + contextNotify(const char *path, + svn_wc_notify_action_t action, + svn_node_kind_t kind, + const char *mime_type, + svn_wc_notify_state_t content_state, + svn_wc_notify_state_t prop_state, + svn_revnum_t revision) = 0; /* * this method will be called periodically to allow @@ -100,7 +100,7 @@ namespace svn * this method will be called to retrieve * a log message * - * WORKAROUND FOR apr_xlate PROBLEM: + * WORKAROUND FOR apr_xlate PROBLEM: * STRINGS ALREADY HAVE TO BE UTF8!!! * * @param msg log message @@ -108,7 +108,7 @@ namespace svn * @retval true continue */ virtual bool - contextGetLogMessage (std::string & msg) = 0; + contextGetLogMessage(std::string & msg) = 0; typedef enum { @@ -124,7 +124,7 @@ namespace svn */ struct SslServerTrustData { - public: +public: /** bit coded failures */ apr_uint32_t failures; @@ -137,15 +137,15 @@ namespace svn std::string realm; bool maySave; - SslServerTrustData (const apr_uint32_t failures_ = 0) - : failures (failures_), hostname (""), fingerprint (""), - validFrom (""), validUntil (""), issuerDName (""), - realm (""), maySave (true) + SslServerTrustData(const apr_uint32_t failures_ = 0) + : failures(failures_), hostname(""), fingerprint(""), + validFrom(""), validUntil(""), issuerDName(""), + realm(""), maySave(true) { } - SslServerTrustData (const SslServerTrustData & src) - : failures (src.failures) + SslServerTrustData(const SslServerTrustData & src) + : failures(src.failures) { hostname = src.hostname; fingerprint = src.fingerprint; @@ -172,7 +172,7 @@ namespace svn failures = src.failures; return *this; - } + } }; @@ -180,20 +180,20 @@ namespace svn * this method is called if there is ssl server * information, that has to be confirmed by the user * - * @param data + * @param data * @param acceptedFailures * @return @a SslServerTrustAnswer */ virtual SslServerTrustAnswer - contextSslServerTrustPrompt (const SslServerTrustData & data, - apr_uint32_t & acceptedFailures) = 0; + contextSslServerTrustPrompt(const SslServerTrustData & data, + apr_uint32_t & acceptedFailures) = 0; /** * this method is called to retrieve client side * information */ - virtual bool - contextSslClientCertPrompt (std::string & certFile) = 0; + virtual bool + contextSslClientCertPrompt(std::string & certFile) = 0; /** * this method is called to retrieve the password @@ -204,11 +204,11 @@ namespace svn * @param maySave */ virtual bool - contextSslClientCertPwPrompt (std::string & password, - const std::string & realm, - bool & maySave) = 0; + contextSslClientCertPwPrompt(std::string & password, + const std::string & realm, + bool & maySave) = 0; - virtual ~ContextListener () { } + virtual ~ContextListener() { } }; } diff --git a/include/svncpp/datetime.hpp b/include/svncpp/datetime.hpp index 00d9d9ad..f2bfd0fa 100644 --- a/include/svncpp/datetime.hpp +++ b/include/svncpp/datetime.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -23,7 +23,7 @@ */ #ifndef _SVNCPP_DATETIME_HPP_ -#define _SVNCPP_DATETIME_HPP_ +#define _SVNCPP_DATETIME_HPP_ // subversion api #include "svn_types.h" @@ -46,21 +46,21 @@ namespace svn /** * Default Constructor */ - DateTime (); + DateTime(); /** * Constructor * * @param time number of microseconds since 00:00:00 january 1, 1970 UTC */ - DateTime (const apr_time_t time); + DateTime(const apr_time_t time); /** * Copy constructor * * @param dateTime Source */ - DateTime (const DateTime & dateTime); + DateTime(const DateTime & dateTime); /** * @param dateTime Source @@ -84,13 +84,13 @@ namespace svn * @return Is a valid (non-zero) date */ const bool - IsValid () const; + IsValid() const; /** * @return APR apr_time_t */ const apr_time_t - GetAPRTimeT () const; + GetAPRTimeT() const; /** * Set from date string of the form below, using apr_date_parse_rfc @@ -98,12 +98,12 @@ namespace svn *
      *     Sun, 06 Nov 1994 08:49:37 GMT
      * 
- * + * * @see apr_date_parse_rfc * @return Successfully parsed */ const bool - SetRFC822Date (const char* date); + SetRFC822Date(const char* date); }; } diff --git a/include/svncpp/dirent.hpp b/include/svncpp/dirent.hpp index d1a69da6..f3254ec7 100644 --- a/include/svncpp/dirent.hpp +++ b/include/svncpp/dirent.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -23,7 +23,7 @@ */ #ifndef _SVNCPP_DIRENT_HPP_ -#define _SVNCPP_DIRENT_HPP_ +#define _SVNCPP_DIRENT_HPP_ // subversion api #include "svn_client.h" @@ -36,22 +36,22 @@ namespace svn /** * default constructor */ - DirEntry (); + DirEntry(); /** * constructor for existing @a svn_dirent_t entries */ - DirEntry (const char * name, svn_dirent_t * dirEntry); + DirEntry(const char * name, svn_dirent_t * dirEntry); /** * copy constructor */ - DirEntry (const DirEntry & src); + DirEntry(const DirEntry & src); /** * destructor */ - ~DirEntry (); + ~DirEntry(); /** * assignment operator @@ -60,25 +60,25 @@ namespace svn operator = (const DirEntry &); const char * - name () const; + name() const; - svn_node_kind_t - kind () const; + svn_node_kind_t + kind() const; svn_filesize_t - size () const; + size() const; bool - hasProps () const; + hasProps() const; svn_revnum_t - createdRev () const; + createdRev() const; apr_time_t - time () const; + time() const; const char * - lastAuthor () const; + lastAuthor() const; private: struct Data; diff --git a/include/svncpp/entry.hpp b/include/svncpp/entry.hpp index e1c21034..fc23e451 100644 --- a/include/svncpp/entry.hpp +++ b/include/svncpp/entry.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,7 +34,7 @@ namespace svn { /** - * C++ API for Subversion. + * C++ API for Subversion. * This class wraps around @a svn_wc_entry_t. */ class Entry @@ -42,7 +42,7 @@ namespace svn public: /** * default constructor. if @a src is set, - * copy its contents. + * copy its contents. * * If @a src is not set (=0) this will be * a non-versioned entry. This can be checked @@ -50,27 +50,27 @@ namespace svn * * @param src another entry to copy from */ - Entry (const svn_wc_entry_t * src = 0); + Entry(const svn_wc_entry_t * src = 0); /** * copy constructor */ - Entry (const Entry & src); + Entry(const Entry & src); /** - * destructor + * destructor */ - virtual ~Entry (); + virtual ~Entry(); /** * returns whether this is a valid=versioned - * entry. + * entry. * * @return is entry valid * @retval true valid entry * @retval false invalid or unversioned entry */ - bool isValid () const + bool isValid() const { return m_valid; } @@ -79,7 +79,7 @@ namespace svn * @return entry's name */ const char * - name () const + name() const { return m_entry->name; } @@ -87,8 +87,8 @@ namespace svn /** * @return base revision */ - const svn_revnum_t - revision () const + const svn_revnum_t + revision() const { return m_entry->revision; } @@ -96,8 +96,8 @@ namespace svn /** * @return url in repository */ - const char * - url () const + const char * + url() const { return m_entry->url; } @@ -106,7 +106,7 @@ namespace svn * @return canonical repository url */ const char * - repos () const + repos() const { return m_entry->repos; } @@ -115,7 +115,7 @@ namespace svn * @return repository uuid */ const char * - uuid () const + uuid() const { return m_entry->uuid; } @@ -124,7 +124,7 @@ namespace svn * @return node kind (file, dir, ...) */ const svn_node_kind_t - kind () const + kind() const { return m_entry->kind; } @@ -133,7 +133,7 @@ namespace svn * @return scheduling (add, delete, replace) */ const svn_wc_schedule_t - schedule () const + schedule() const { return m_entry->schedule; } @@ -141,17 +141,17 @@ namespace svn /** * @return TRUE if copied */ - const bool - isCopied () const + const bool + isCopied() const { return m_entry->copied != 0; } - + /** * @return true if deleted */ const bool - isDeleted () const + isDeleted() const { return m_entry->deleted != 0; } @@ -160,7 +160,7 @@ namespace svn * @return true if deleted */ const bool - isAbsent () const + isAbsent() const { return m_entry->absent != 0; } @@ -169,7 +169,7 @@ namespace svn * @return copyfrom location */ const char * - copyfromUrl () const + copyfromUrl() const { return m_entry->copyfrom_url; } @@ -178,7 +178,7 @@ namespace svn * @return copyfrom revision */ const svn_revnum_t - copyfromRev () const + copyfromRev() const { return m_entry->copyfrom_rev; } @@ -187,7 +187,7 @@ namespace svn * @return old version of conflicted file */ const char * - conflictOld () const + conflictOld() const { return m_entry->conflict_old; } @@ -196,16 +196,16 @@ namespace svn * @return new version of conflicted file */ const char * - conflictNew () const + conflictNew() const { return m_entry->conflict_new; } - + /** * @return working version of conflicted file */ const char * - conflictWrk () const + conflictWrk() const { return m_entry->conflict_wrk; } @@ -214,7 +214,7 @@ namespace svn * @return property reject file */ const char * - prejfile () const + prejfile() const { return m_entry->prejfile; } @@ -224,17 +224,17 @@ namespace svn * @retval 0 no information available */ const apr_time_t - textTime () const + textTime() const { return m_entry->text_time; } - + /** * @return last up-to-date time for properties * @retval 0 no information available */ const apr_time_t - propTime () const + propTime() const { return m_entry->prop_time; } @@ -244,7 +244,7 @@ namespace svn * @retval NULL for backwards compatibility */ const char * - checksum () const + checksum() const { return m_entry->checksum; } @@ -253,7 +253,7 @@ namespace svn * @return last revision this was changed */ const svn_revnum_t - cmtRev () const + cmtRev() const { return m_entry->cmt_rev; } @@ -262,7 +262,7 @@ namespace svn * @return last date this was changed */ const apr_time_t - cmtDate () const + cmtDate() const { return m_entry->cmt_date; } @@ -271,7 +271,7 @@ namespace svn * @return last commit author of this file */ const char * - cmtAuthor () const + cmtAuthor() const { return m_entry->cmt_author; } @@ -298,9 +298,9 @@ namespace svn /** * initializes the members */ - void - init (const svn_wc_entry_t * src); - }; + void + init(const svn_wc_entry_t * src); + }; } diff --git a/include/svncpp/exception.hpp b/include/svncpp/exception.hpp index ad92ee6d..25b3ed3a 100644 --- a/include/svncpp/exception.hpp +++ b/include/svncpp/exception.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -41,19 +41,19 @@ namespace svn /** * Constructor. Assigns the exception reason. */ - Exception (const char * message) throw (); + Exception(const char * message) throw(); - ~Exception () throw (); + ~Exception() throw(); /** * @return the exception message. */ - const char * message () const; + const char * message() const; /** * @return the outermost error code. */ - const apr_status_t apr_err () const; + const apr_status_t apr_err() const; protected: struct Data; @@ -61,10 +61,10 @@ namespace svn private: - Exception (const Exception &) throw (); + Exception(const Exception &) throw(); + + Exception() throw(); - Exception () throw (); - Exception & operator = (const Exception &); }; @@ -77,29 +77,29 @@ namespace svn /** * Constructor. Sets the error template and an optional message. */ - ClientException (svn_error_t * error) throw (); + ClientException(svn_error_t * error) throw(); /** * Constructor that takes only an apr errorcode */ - ClientException (apr_status_t status) throw (); + ClientException(apr_status_t status) throw(); - ClientException (const char * message) throw () - : Exception (message) + ClientException(const char * message) throw() + : Exception(message) { } - - /** + + /** * Copy constructor */ - ClientException (const ClientException & src) throw (); + ClientException(const ClientException & src) throw(); - virtual ~ClientException () throw (); + virtual ~ClientException() throw(); private: - ClientException () throw (); + ClientException() throw(); ClientException & operator = (ClientException &); }; diff --git a/include/svncpp/info.hpp b/include/svncpp/info.hpp index d2044c67..e898ac4a 100644 --- a/include/svncpp/info.hpp +++ b/include/svncpp/info.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -31,9 +31,9 @@ namespace svn { // forward declarations class Path; - + /** - * C++ API for Subversion. + * C++ API for Subversion. * This class wraps around @a svn_info_t. */ class Info @@ -41,7 +41,7 @@ namespace svn public: /** * default constructor. if @a src is set, - * copy its contents. + * copy its contents. * * If @a src is not set (=0) this will be * a non-versioned entry. This can be checked @@ -49,17 +49,17 @@ namespace svn * * @param src another entry to copy from */ - Info (const Path & path, const svn_info_t * src = 0); + Info(const Path & path, const svn_info_t * src = 0); /** * copy constructor */ - Info (const Info & src); + Info(const Info & src); /** - * destructor + * destructor */ - virtual ~Info (); + virtual ~Info(); /** * assignment operator @@ -69,54 +69,54 @@ namespace svn /** * returns whether this is a valid=versioned - * entry. + * entry. * * @return is entry valid * @retval true valid entry * @retval false invalid or unversioned entry */ - bool isValid () const; + bool isValid() const; /** @return entry's name */ - const Path & - path () const; + const Path & + path() const; /** @return base revision */ - const svn_revnum_t - revision () const; + const svn_revnum_t + revision() const; /** @return url in repository */ - const char * - url () const; + const char * + url() const; /** @return canonical repository url */ const char * - repos () const; + repos() const; /** @return repository uuid */ const char * - uuid () const; + uuid() const; /** @return node kind (file, dir, ...) */ const svn_node_kind_t - kind () const; - + kind() const; + svn_revnum_t - lastChangedRev () const; - + lastChangedRev() const; + apr_time_t - lastChangedDate () const; - + lastChangedDate() const; + const char * - lastChangedAuthoer () const; - + lastChangedAuthoer() const; + /** @todo MORE ENTRIES FROM @ref svn_info_to IF NEEDED */ - + private: struct Data; - + Data * m; - }; + }; } diff --git a/include/svncpp/log_entry.hpp b/include/svncpp/log_entry.hpp index b089d36c..c2c1a3da 100644 --- a/include/svncpp/log_entry.hpp +++ b/include/svncpp/log_entry.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -40,10 +40,10 @@ namespace svn struct LogChangePathEntry { - LogChangePathEntry (const char *path_, - char action_, - const char *copyFromPath_, - const svn_revnum_t copyFromRevision_); + LogChangePathEntry(const char *path_, + char action_, + const char *copyFromPath_, + const svn_revnum_t copyFromRevision_); std::string path; char action; @@ -54,13 +54,13 @@ namespace svn struct LogEntry { - public: - LogEntry (); +public: + LogEntry(); - LogEntry (const svn_revnum_t revision, - const char * author, - const char * date, - const char * message); + LogEntry(const svn_revnum_t revision, + const char * author, + const char * date, + const char * message); svn_revnum_t revision; std::string author; diff --git a/include/svncpp/map_wrapper.hpp b/include/svncpp/map_wrapper.hpp index 2afcf08e..016393fa 100644 --- a/include/svncpp/map_wrapper.hpp +++ b/include/svncpp/map_wrapper.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/include/svncpp/path.hpp b/include/svncpp/path.hpp index c153e20c..d260b11d 100644 --- a/include/svncpp/path.hpp +++ b/include/svncpp/path.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -44,7 +44,7 @@ namespace svn * * @param path Path string */ - void init (const char * path); + void init(const char * path); public: /** @@ -54,22 +54,22 @@ namespace svn * * @param path Path string */ - Path (const std::string & path = ""); - + Path(const std::string & path = ""); + /** * Constructor * * @see Path::Path (const std::string &) * @param path Path string */ - Path (const char * path); + Path(const char * path); /** * Copy constructor * * @param path Path to be copied */ - Path (const Path & path); + Path(const Path & path); /** * Assignment operator @@ -86,13 +86,13 @@ namespace svn * @return Path string */ const std::string & - path () const; + path() const; /** * @return Path string as c string */ - const char * - c_str () const; + const char * + c_str() const; /** * check whether a path is set. Right now @@ -101,8 +101,8 @@ namespace svn * * @return true if there is a path set */ - bool - isset () const; + bool + isset() const; /** * shows whether we have a path or url @@ -110,7 +110,7 @@ namespace svn * @return true if the path is a valid url */ const bool - isUrl () const; + isUrl() const; /** * adds a new URL component to the path @@ -118,7 +118,7 @@ namespace svn * @param component new component to add */ void - addComponent (const char * component); + addComponent(const char * component); /** * adds a new URL component to the path @@ -126,7 +126,7 @@ namespace svn * @param component new component to add */ void - addComponent (const std::string & component); + addComponent(const std::string & component); /** * split path in its components @@ -135,7 +135,7 @@ namespace svn * @param basename filename */ void - split (std::string & dirpath, std::string & basename) const; + split(std::string & dirpath, std::string & basename) const; /** * split path in its components including @@ -146,7 +146,7 @@ namespace svn * @param ext extension (including leading dot ".") */ void - split (std::string & dir, std::string & filename, std::string & ext) const; + split(std::string & dir, std::string & filename, std::string & ext) const; /** * get a basename of a file @@ -154,7 +154,7 @@ namespace svn * @return basename filename without path */ std::string - basename () const; + basename() const; /** * get a name of directory containing file @@ -162,16 +162,16 @@ namespace svn * @return dirpath path of directory */ std::string - dirpath () const; + dirpath() const; /** * get a substring of a path, starting at index * - * @param index + * @param index * @return substr substring */ std::string - substr (const size_t index) const; + substr(const size_t index) const; /** * return path as a string with unescaped special characters @@ -179,21 +179,21 @@ namespace svn * @return unescaped path */ std::string - unescape () const; + unescape() const; /** * returns the temporary directory */ static Path - getTempDir (); + getTempDir(); /** return the length of the path-string */ - size_t - length () const; + size_t + length() const; /** returns the path with native separators */ std::string - native () const; + native() const; }; } diff --git a/include/svncpp/pool.hpp b/include/svncpp/pool.hpp index 9edd1cff..3b890a9b 100644 --- a/include/svncpp/pool.hpp +++ b/include/svncpp/pool.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -41,20 +41,20 @@ namespace svn * * @param parent NULL -> global pool */ - Pool (apr_pool_t * parent = (apr_pool_t *)0); + Pool(apr_pool_t * parent = (apr_pool_t *)0); - virtual ~ Pool (); + virtual ~ Pool(); /** * @return apr handle to the pool */ - apr_pool_t * - pool () const; + apr_pool_t * + pool() const; /** * operator to return apr handle to the pool */ - operator apr_pool_t * () const + operator apr_pool_t * () const { return m_pool; } @@ -62,7 +62,7 @@ namespace svn /** * release pool and create a new one */ - void renew (); + void renew(); private: apr_pool_t * m_parent; @@ -70,7 +70,7 @@ namespace svn Pool& operator=(const Pool&); - Pool (const Pool &); + Pool(const Pool &); }; } diff --git a/include/svncpp/property.hpp b/include/svncpp/property.hpp index 639c9cba..05e92060 100644 --- a/include/svncpp/property.hpp +++ b/include/svncpp/property.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,7 +37,7 @@ #endif -// stl +// stl #include "svncpp/vector_wrapper.hpp" #include "svncpp/string_wrapper.hpp" @@ -52,8 +52,8 @@ namespace svn std::string name; std::string value; - PropertyEntry (const char * name, const char * value); - }; + PropertyEntry(const char * name, const char * value); + }; // forward declarations class Path; @@ -61,45 +61,45 @@ namespace svn /** * Class for manipulating Subversion properties. */ - class Property + class Property { public: - Property (Context * context = 0, - const Path & path = ""); + Property(Context * context = 0, + const Path & path = ""); - virtual ~Property (); + virtual ~Property(); /** * get the list of properties for the path. * throws an exception if the path isnt versioned. */ const std::vector & - entries () const + entries() const { return m_entries; } /** - * Sets an existing property with a new value or adds a new - * property. If a result is added it does not reload the + * Sets an existing property with a new value or adds a new + * property. If a result is added it does not reload the * result set. Run loadPath again. * @exception ClientException */ - void set (const char * name, const char * value); + void set(const char * name, const char * value); /** - * Deletes a property. + * Deletes a property. * @exception ClientException */ - void remove (const char * name); + void remove(const char * name); private: Context * m_context; Path m_path; std::vector m_entries; - std::string getValue (const char * name); - void list (); + std::string getValue(const char * name); + void list(); }; } diff --git a/include/svncpp/revision.hpp b/include/svncpp/revision.hpp index 306702f7..547ed149 100644 --- a/include/svncpp/revision.hpp +++ b/include/svncpp/revision.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -23,7 +23,7 @@ */ #ifndef _SVNCPP_REVISION_HPP_ -#define _SVNCPP_REVISION_HPP_ +#define _SVNCPP_REVISION_HPP_ // subversion api #include "svn_types.h" @@ -45,7 +45,7 @@ namespace svn svn_opt_revision_t m_revision; void - init (const svn_opt_revision_t * revision); + init(const svn_opt_revision_t * revision); public: static const Revision START; @@ -59,41 +59,41 @@ namespace svn * * @param revision revision information */ - Revision (const svn_opt_revision_t * revision); + Revision(const svn_opt_revision_t * revision); /** * Constructor * * @param revnum revision number */ - Revision (const svn_revnum_t revnum); + Revision(const svn_revnum_t revnum); /** * Constructor * * @param kind */ - Revision (const svn_opt_revision_kind kind = svn_opt_revision_unspecified); + Revision(const svn_opt_revision_kind kind = svn_opt_revision_unspecified); /** * Constructor * * @param dateTime DateTime wrapper for apr_time_t */ - Revision (const DateTime dateTime); + Revision(const DateTime dateTime); /** * Copy constructor * * @param revision Source */ - Revision (const Revision & revision); + Revision(const Revision & revision); /** * @return revision information */ const svn_opt_revision_t * - revision () const; + revision() const; /** * @see revision (). Same function @@ -107,29 +107,29 @@ namespace svn /** * @return revision numver */ - const svn_revnum_t - revnum () const; + const svn_revnum_t + revnum() const; /** * @return revision kind */ - const svn_opt_revision_kind - kind () const; + const svn_opt_revision_kind + kind() const; /** * @see kind (). Same function * but with operator overloading */ - operator svn_opt_revision_kind () const + operator svn_opt_revision_kind() const { - return kind (); + return kind(); } /** * @return date */ const apr_time_t - date () const; + date() const; }; } diff --git a/include/svncpp/status.hpp b/include/svncpp/status.hpp index cc1db449..52b9fa1b 100644 --- a/include/svncpp/status.hpp +++ b/include/svncpp/status.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -47,108 +47,108 @@ namespace svn * @param path * @param status */ - Status (const char * path = 0, const svn_wc_status2_t * status = 0); + Status(const char * path = 0, const svn_wc_status2_t * status = 0); /** * copy constructor */ - Status (const Status & src); + Status(const Status & src); /** * destructor */ - ~Status (); + ~Status(); /** * @return path of status entry */ const char * - path () const; + path() const; /** * @return entry for this path * @retval entry.isValid () = false item is not versioned */ - const Entry - entry () const; + const Entry + entry() const; /** - * @return file status property enum of the "textual" component. + * @return file status property enum of the "textual" component. */ - const svn_wc_status_kind - textStatus () const; + const svn_wc_status_kind + textStatus() const; /** - * @return file status property enum of the "property" component. + * @return file status property enum of the "property" component. */ - const svn_wc_status_kind - propStatus () const; + const svn_wc_status_kind + propStatus() const; /** * @retval TRUE if under version control */ - const bool - isVersioned () const; + const bool + isVersioned() const; /** * @retval TRUE if copied */ - const bool - isCopied () const; + const bool + isCopied() const; /** * @retval TRUE if switched */ const bool - isSwitched () const; + isSwitched() const; /** * @return the entry's text status in the repository */ const svn_wc_status_kind - reposTextStatus () const; + reposTextStatus() const; /** * @return the entry's prop status in the repository */ const svn_wc_status_kind - reposPropStatus () const; + reposPropStatus() const; /** * @return true if locked */ const bool - isLocked () const; + isLocked() const; /** * @return true if has repository lock (not local) */ const bool - isRepLock () const; + isRepLock() const; /** * @return lock token or null if not locked */ const char * - lockToken () const; + lockToken() const; /** * @return lock owner or null if not locked */ const char * - lockOwner () const; + lockOwner() const; /** * @return comment lock, null or no comment */ const char * - lockComment () const; + lockComment() const; /** * @return lock creation date or 0 if not locked */ const apr_time_t - lockCreationDate () const; + lockCreationDate() const; /** * assignment operator @@ -156,13 +156,13 @@ namespace svn Status & operator = (const Status &); - /** + /** * check whether the instance contains real data * or nothing if it has constructed with the default * constructor */ bool - isset () const; + isset() const; private: struct Data; diff --git a/include/svncpp/status_selection.hpp b/include/svncpp/status_selection.hpp index 9b36e5c4..76a42919 100644 --- a/include/svncpp/status_selection.hpp +++ b/include/svncpp/status_selection.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -45,22 +45,22 @@ namespace svn class StatusSel { public: - /** + /** * default constructor */ - StatusSel (); - + StatusSel(); + /** * Destructor */ - virtual ~ StatusSel (); + virtual ~ StatusSel(); /** * Copy Constructor * * @param src Source */ - StatusSel (const StatusSel & src); + StatusSel(const StatusSel & src); /** * Assignment operator @@ -75,15 +75,15 @@ namespace svn * @param pool Pool used for conversion */ const apr_array_header_t * - array (const Pool & pool) const; + array(const Pool & pool) const; /** * Returns a vector of paths * * @return vector of paths */ - const Targets & - targets () const; + const Targets & + targets() const; /** * returns the first target in the list @@ -92,32 +92,32 @@ namespace svn * @return the first @ref Path in the list */ const Path & - target () const; + target() const; /** * @return the number of targets */ - size_t size () const; - + size_t size() const; + /** - * reserves @a size + * reserves @a size */ void - reserve (size_t size); - + reserve(size_t size); + /** - * add and check the next entry + * add and check the next entry * * @param status @ref Status to add */ void - push_back (const Status & status); - + push_back(const Status & status); + /** * cleans out all entries */ void - clear (); + clear(); /** * operator to return the vector @@ -127,28 +127,28 @@ namespace svn operator const std::vector & () const; /** at least one target is a file */ - bool - hasFiles () const; + bool + hasFiles() const; /** at least one target is a directory */ - bool - hasDirs () const; + bool + hasDirs() const; /** at least one target is versioned */ - bool - hasVersioned () const; + bool + hasVersioned() const; /** at least one target is unversioned */ - bool - hasUnversioned () const; + bool + hasUnversioned() const; /** at least one target is a repository URL */ - bool - hasUrl () const; + bool + hasUrl() const; /** at least one target is a local file or dir */ - bool - hasLocal () const; + bool + hasLocal() const; private: struct Data; diff --git a/include/svncpp/string_wrapper.hpp b/include/svncpp/string_wrapper.hpp index 1fa2f6e5..5bfa0340 100644 --- a/include/svncpp/string_wrapper.hpp +++ b/include/svncpp/string_wrapper.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/include/svncpp/targets.hpp b/include/svncpp/targets.hpp index e1ca8b02..44abd880 100644 --- a/include/svncpp/targets.hpp +++ b/include/svncpp/targets.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -44,20 +44,20 @@ namespace svn class Targets { public: - /** + /** * Constructor * * @param targets vector of paths */ - Targets (const std::vector & targets); - + Targets(const std::vector & targets); + /** * Constructor from an APR array containing * char *. * * @param targets APR array header */ - Targets (const apr_array_header_t * targets); + Targets(const apr_array_header_t * targets); /** * Constructor. Initializes list with just @@ -65,19 +65,19 @@ namespace svn * * @param target */ - Targets (const char * target = 0); + Targets(const char * target = 0); /** * Copy Constructor * * @param targets Source */ - Targets (const Targets & targets); + Targets(const Targets & targets); /** * Destructor */ - virtual ~Targets (); + virtual ~Targets(); /** * Returns an apr array containing @@ -86,7 +86,7 @@ namespace svn * @param pool Pool used for conversion */ const apr_array_header_t * - array (const Pool & pool) const; + array(const Pool & pool) const; /** * Returns a vector of paths @@ -99,7 +99,7 @@ namespace svn /** * @return the number of targets */ - size_t size () const; + size_t size() const; /** * operator to return the vector @@ -120,7 +120,7 @@ namespace svn * @return single path */ const Path - target () const; + target() const; /** * adds a @ref Path to the existing entries @@ -129,21 +129,21 @@ namespace svn * unique */ void - push_back (const Path & path); + push_back(const Path & path); + - /** - * clears all entries + * clears all entries */ void - clear (); + clear(); /** * reserve the size for following calls * to @ref push_back */ void - reserve (size_t size); + reserve(size_t size); private: std::vector m_targets; diff --git a/include/svncpp/url.hpp b/include/svncpp/url.hpp index a863323d..28b51b03 100644 --- a/include/svncpp/url.hpp +++ b/include/svncpp/url.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,10 +34,10 @@ namespace svn { public: /** Constructor */ - Url (); + Url(); /** Destructor */ - virtual ~Url (); + virtual ~Url(); /** * Checks if @a url is valid @@ -48,7 +48,7 @@ namespace svn * /home/foo/bar */ static bool - isValid (const char * urlToValidate); + isValid(const char * urlToValidate); /** * returns a url with forbidden charachters like spaces escaped @@ -59,7 +59,7 @@ namespace svn * http://rapidsvn.tigris.org/x%20y%20z.html */ static std::string - escape (const char * url); + escape(const char * url); /** * returns a url with forbidden charachters like spaces unescaped @@ -67,17 +67,17 @@ namespace svn * Undo the changes done by the previous function, escape () */ static std::string - unescape (const char * url); + unescape(const char * url); /** * returns a vector with url schemas that are - * supported by svn + * supported by svn * * @return vector with entries like "file:", "http:" * @deprecated since 0.9.1 (returns an empty vector now) */ static std::vector - supportedSchemas (); + supportedSchemas(); }; } diff --git a/include/svncpp/utility_wrapper.hpp b/include/svncpp/utility_wrapper.hpp index 5aec4bd3..c76c5c9c 100644 --- a/include/svncpp/utility_wrapper.hpp +++ b/include/svncpp/utility_wrapper.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/include/svncpp/vector_wrapper.hpp b/include/svncpp/vector_wrapper.hpp index 76bd9cc5..0f938a17 100644 --- a/include/svncpp/vector_wrapper.hpp +++ b/include/svncpp/vector_wrapper.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/include/svncpp/version.hpp b/include/svncpp/version.hpp index 8dc9099c..1080516f 100644 --- a/include/svncpp/version.hpp +++ b/include/svncpp/version.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/include/svncpp/wc.hpp b/include/svncpp/wc.hpp index 3beb98f4..452a4018 100644 --- a/include/svncpp/wc.hpp +++ b/include/svncpp/wc.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -23,7 +23,7 @@ */ #ifndef _SVNCPP_WC_HPP_ -#define _SVNCPP_WC_HPP_ +#define _SVNCPP_WC_HPP_ // svncpp #include "svncpp/revision.hpp" @@ -46,11 +46,11 @@ namespace svn * @param dir path to a directory * @return true=valid working copy */ - static bool - checkWc (const char * dir); + static bool + checkWc(const char * dir); static bool - checkWc (const Path & dir); + checkWc(const Path & dir); /** * ensure that an administrative area exists for @a dir, so that @a dir @@ -62,8 +62,8 @@ namespace svn * @param revision expected working copy revision */ static void - ensureAdm (const char * dir, const char * uuid, - const char * url, const Revision & revision); + ensureAdm(const char * dir, const char * uuid, + const char * url, const Revision & revision); /** * use \a dir as name for the subversion administrative directory @@ -71,16 +71,16 @@ namespace svn * * @param dir */ - static void - setAdmDir (const char * dir); + static void + setAdmDir(const char * dir); /** * checks whether @a name is an administrative directory - * + * * @remarks @a name may only be a filename, not an absolute path */ static bool - isAdmDir (const char * name); + isAdmDir(const char * name); private: }; diff --git a/src/about_dlg.cpp b/src/about_dlg.cpp index f4399db1..726f2323 100644 --- a/src/about_dlg.cpp +++ b/src/about_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,37 +35,37 @@ #include "res/bitmaps/logo.png.h" #include "utils.hpp" -AboutDlg::AboutDlg (wxWindow * parent, const wxLocale & locale) - : wxDialog (parent, -1, wxEmptyString, wxDefaultPosition) +AboutDlg::AboutDlg(wxWindow * parent, const wxLocale & locale) + : wxDialog(parent, -1, wxEmptyString, wxDefaultPosition) { - const wxString title (wxString::Format( - _("About %s"), APPLICATION_NAME)); - SetTitle (title); + const wxString title(wxString::Format( + _("About %s"), APPLICATION_NAME)); + SetTitle(title); // format string - const wxString version (wxString::Format ( - _("%s Version %s"), - APPLICATION_NAME, Utf8ToLocal (RAPIDSVN_VER_STR).c_str ())); + const wxString version(wxString::Format( + _("%s Version %s"), + APPLICATION_NAME, Utf8ToLocal(RAPIDSVN_VER_STR).c_str())); // TODO: Make these two constants in version.hpp translatable and wxT()'ed respectively. // Until then use the kludge of pretending they're UTF8 to save some silly looking ifdef's - const wxString strCopyrightMessage (Utf8ToLocal (RAPIDSVN_COPYRIGHT)); - const wxString strVerMilestone (Utf8ToLocal (RAPIDSVN_VER_MILESTONE)); + const wxString strCopyrightMessage(Utf8ToLocal(RAPIDSVN_COPYRIGHT)); + const wxString strVerMilestone(Utf8ToLocal(RAPIDSVN_VER_MILESTONE)); #ifdef wxUSE_UNICODE - wxString unicode (_("Unicode")); + wxString unicode(_("Unicode")); #else - wxString unicode (_("ANSI")); + wxString unicode(_("ANSI")); #endif - const wxString copy (wxString::Format( - wxT("%s\n") // version - wxT("\n%s\n\n") // copyright - wxT("%s\n") // for more information - wxT("http://rapidsvn.tigris.org"), - version.c_str (), - strCopyrightMessage.c_str (), - _("For more information see:"))); + const wxString copy(wxString::Format( + wxT("%s\n") // version + wxT("\n%s\n\n") // copyright + wxT("%s\n") // for more information + wxT("http://rapidsvn.tigris.org"), + version.c_str(), + strCopyrightMessage.c_str(), + _("For more information see:"))); const wxString builtFmt(_("\ @@ -79,35 +79,35 @@ Language: %s\n\ System Name: %s\n\ Canonical Name: %s\n")); - const wxString built (wxString::Format ( - builtFmt, - wxMAJOR_VERSION, wxMINOR_VERSION, - wxRELEASE_NUMBER, unicode.c_str (), - SVN_VER_MAJOR, SVN_VER_MINOR, SVN_VER_MICRO)); + const wxString built(wxString::Format( + builtFmt, + wxMAJOR_VERSION, wxMINOR_VERSION, + wxRELEASE_NUMBER, unicode.c_str(), + SVN_VER_MAJOR, SVN_VER_MINOR, SVN_VER_MICRO)); - const wxString info (wxString::Format( - infoFmt, - locale.GetLocale (), locale.GetSysName ().c_str (), - locale.GetCanonicalName ().c_str ())); + const wxString info(wxString::Format( + infoFmt, + locale.GetLocale(), locale.GetSysName().c_str(), + locale.GetCanonicalName().c_str())); // create controls wxStaticBitmap * logo = - new wxStaticBitmap (this, -1, EMBEDDED_BITMAP(logo_png)); - wxStaticText * labelCopy = new wxStaticText (this, -1, copy); - wxStaticText * labelBuilt = new wxStaticText (this, -1, built); - wxStaticText * labelInfo = new wxStaticText (this, -1, info); - wxButton * button = new wxButton (this, wxID_OK, _("OK")); + new wxStaticBitmap(this, -1, EMBEDDED_BITMAP(logo_png)); + wxStaticText * labelCopy = new wxStaticText(this, -1, copy); + wxStaticText * labelBuilt = new wxStaticText(this, -1, built); + wxStaticText * labelInfo = new wxStaticText(this, -1, info); + wxButton * button = new wxButton(this, wxID_OK, _("OK")); // position controls - wxFlexGridSizer * topSizer = new wxFlexGridSizer (2, 10, 10); - topSizer->Add (logo, 0); - topSizer->Add (labelCopy, 1, wxEXPAND); - topSizer->Add (labelBuilt, 0, wxALL); - topSizer->Add (labelInfo, 0, wxALL); + wxFlexGridSizer * topSizer = new wxFlexGridSizer(2, 10, 10); + topSizer->Add(logo, 0); + topSizer->Add(labelCopy, 1, wxEXPAND); + topSizer->Add(labelBuilt, 0, wxALL); + topSizer->Add(labelInfo, 0, wxALL); - wxBoxSizer * mainSizer = new wxBoxSizer (wxVERTICAL); - mainSizer->Add (topSizer, 0, wxALL, 5); - mainSizer->Add (button, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5); + wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(topSizer, 0, wxALL, 5); + mainSizer->Add(button, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5); SetAutoLayout(true); SetSizer(mainSizer); @@ -115,10 +115,10 @@ Canonical Name: %s\n")); mainSizer->SetSizeHints(this); mainSizer->Fit(this); - CentreOnParent (); + CentreOnParent(); } -AboutDlg::~AboutDlg () +AboutDlg::~AboutDlg() { } diff --git a/src/about_dlg.hpp b/src/about_dlg.hpp index 7260e8db..4e470590 100644 --- a/src/about_dlg.hpp +++ b/src/about_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -40,12 +40,12 @@ class AboutDlg : public wxDialog * @param parent parent window * @param locale locale used by the application */ - AboutDlg (wxWindow * parent, const wxLocale & locale); + AboutDlg(wxWindow * parent, const wxLocale & locale); /** * destructor */ - virtual ~AboutDlg (); + virtual ~AboutDlg(); }; diff --git a/src/action.cpp b/src/action.cpp index 8126787d..204d13eb 100644 --- a/src/action.cpp +++ b/src/action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -42,13 +42,13 @@ #ifdef USE_SIMPLE_WORKER void -SafeYield () +SafeYield() { - wxSafeYield (); + wxSafeYield(); } #else void -SafeYield () {}; +SafeYield() {}; #endif @@ -95,13 +95,13 @@ struct Action::Data svn::StatusSel statusSel; - Data (wxWindow * parnt, const wxString & nam, unsigned int flgs) - : parent (parnt), name (nam), flags (flgs), - tracer (0), ownTracer (false) + Data(wxWindow * parnt, const wxString & nam, unsigned int flgs) + : parent(parnt), name(nam), flags(flgs), + tracer(0), ownTracer(false) { } - virtual ~Data () + virtual ~Data() { if (tracer && ownTracer) { @@ -116,137 +116,137 @@ const unsigned int Action::UPDATE_LATER = 0x0002; const unsigned int Action::UPDATE_TREE = 0x0004; -Action::Action (wxWindow * parent, const wxString & name, unsigned int flgs) +Action::Action(wxWindow * parent, const wxString & name, unsigned int flgs) { - m = new Data (parent, name, flgs); + m = new Data(parent, name, flgs); } -Action::~Action () +Action::~Action() { delete m; } void -Action::SetTracer (Tracer * t, bool own) +Action::SetTracer(Tracer * t, bool own) { m->tracer = t; m->ownTracer = own; } Tracer * -Action::GetTracer () +Action::GetTracer() { return m->tracer; } wxWindow * -Action::GetParent () +Action::GetParent() { return m->parent; } void -Action::Trace (const wxString & msg) +Action::Trace(const wxString & msg) { if (m->tracer) { - m->tracer->Trace (msg); + m->tracer->Trace(msg); } - SafeYield (); + SafeYield(); } void -Action::TraceError (const wxString & msg) +Action::TraceError(const wxString & msg) { if (m->tracer) { - m->tracer->TraceError (msg); + m->tracer->TraceError(msg); } - SafeYield (); + SafeYield(); } void -Action::SetParent (wxWindow * parent) +Action::SetParent(wxWindow * parent) { m->parent = parent; } void -Action::SetPath (const svn::Path & path) +Action::SetPath(const svn::Path & path) { m->path = path; } const svn::Path & -Action::GetPath () +Action::GetPath() { return m->path; } void -Action::SetContext (svn::Context * context) +Action::SetContext(svn::Context * context) { m->context = context; } svn::Context * -Action::GetContext () +Action::GetContext() { return m->context; } void -Action::SetStatusSel (const svn::StatusSel & statusSel) +Action::SetStatusSel(const svn::StatusSel & statusSel) { m->statusSel = statusSel; } const svn::Targets & -Action::GetTargets () const +Action::GetTargets() const { - return m->statusSel.targets (); + return m->statusSel.targets(); } bool -Action::Prepare () +Action::Prepare() { - wxSetWorkingDirectory (Utf8ToLocal(m->path.c_str ())); + wxSetWorkingDirectory(Utf8ToLocal(m->path.c_str())); return true; } const svn::Path -Action::GetTarget () const +Action::GetTarget() const { - return m->statusSel.target (); + return m->statusSel.target(); } const wxString & -Action::GetName () const +Action::GetName() const { return m->name; } void -Action::SetName (const wxString & name) +Action::SetName(const wxString & name) { m->name = name; } unsigned int -Action::GetFlags () const +Action::GetFlags() const { return m->flags; } svn::Path -Action::GetPathAsTempFile (const svn::Path & path, - const svn::Revision & revision) +Action::GetPathAsTempFile(const svn::Path & path, + const svn::Revision & revision) { - svn::Client client (GetContext ()); - + svn::Client client(GetContext()); + svn::Revision peg_revision; if (path.isUrl()) @@ -255,30 +255,30 @@ Action::GetPathAsTempFile (const svn::Path & path, peg_revision = svn::Revision::BASE; wxString revStr; - if (revision.kind () == revision.HEAD) + if (revision.kind() == revision.HEAD) revStr = _("HEAD"); else if (revision.kind() == revision.BASE) revStr = _("BASE"); else - revStr.Printf (wxT("%") wxT(SVN_REVNUM_T_FMT), revision.revnum ()); + revStr.Printf(wxT("%") wxT(SVN_REVNUM_T_FMT), revision.revnum()); - wxString msg, wxpath (Utf8ToLocal (path.c_str ())); - msg.Printf (_("Get file %s rev. %s"), - wxpath.c_str (), revStr.c_str ()); - Trace (msg); + wxString msg, wxpath(Utf8ToLocal(path.c_str())); + msg.Printf(_("Get file %s rev. %s"), + wxpath.c_str(), revStr.c_str()); + Trace(msg); - svn::Path dstPath (""); - client.get (dstPath, path, revision, peg_revision); + svn::Path dstPath(""); + client.get(dstPath, path, revision, peg_revision); // Remember this temporary file so we can delete it when the application exits - ::wxGetApp ().OptionallyRegisterTempFile ( - Utf8ToLocal (dstPath.c_str ())); + ::wxGetApp().OptionallyRegisterTempFile( + Utf8ToLocal(dstPath.c_str())); return dstPath; } const svn::StatusSel & -Action::GetStatusSel (void) const +Action::GetStatusSel(void) const { return m->statusSel; } diff --git a/src/action.hpp b/src/action.hpp index af10e43e..2189ba89 100644 --- a/src/action.hpp +++ b/src/action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -85,50 +85,50 @@ class Action * @param name of the action * @param flags */ - Action (wxWindow * parent, const wxString & name, - unsigned int flags = 0); + Action(wxWindow * parent, const wxString & name, + unsigned int flags = 0); /** * destructor */ - virtual ~Action (); + virtual ~Action(); /** * @return Tracer instance */ - Tracer * GetTracer (); + Tracer * GetTracer(); /** * Sets the tracer passed as an argument. * If own is TRUE, then the @a Action class * is responsible for deleting the tracer. */ - void SetTracer (Tracer * t, bool own); + void SetTracer(Tracer * t, bool own); /** * set actions parent window * * @param parent the parent that will receive events */ - void SetParent (wxWindow * parent); + void SetParent(wxWindow * parent); /** * @return parent */ - wxWindow * GetParent (); + wxWindow * GetParent(); /** * sets the context for this action * * @param context */ - void SetContext (svn::Context * context); + void SetContext(svn::Context * context); /** * @return the context of the action */ svn::Context * - GetContext (); + GetContext(); /** * Prepare action. This method is execute in the main @@ -145,7 +145,7 @@ class Action * @retval false cancel */ virtual bool - Prepare (); + Prepare(); /** @@ -153,7 +153,7 @@ class Action * will be thrown. */ virtual bool - Perform () = 0; + Perform() = 0; /** * sets the path for the action @@ -161,13 +161,13 @@ class Action * @param path */ void - SetPath (const svn::Path & path); + SetPath(const svn::Path & path); /** * @return path */ const svn::Path & - GetPath (); + GetPath(); /** * sets a selection of @ref Status for the action. @@ -178,25 +178,25 @@ class Action * @param targets */ void - SetStatusSel (const svn::StatusSel & statusSel); + SetStatusSel(const svn::StatusSel & statusSel); /** * @return the status selection for this action */ const svn::StatusSel & - GetStatusSel () const; + GetStatusSel() const; /** * @return the targets for this action */ const svn::Targets & - GetTargets () const; + GetTargets() const; /** * @return a single target for this action */ const svn::Path - GetTarget () const; + GetTarget() const; /** @@ -205,28 +205,28 @@ class Action * @see DONT_UPDATE */ unsigned int - GetFlags () const; + GetFlags() const; /** set the name of the action */ void - SetName (const wxString & name); + SetName(const wxString & name); /** returns the name of the action */ const wxString & - GetName () const; + GetName() const; /** * output message with the tracer */ - void Trace (const wxString & msg); + void Trace(const wxString & msg); /** * output error message with the tracer */ - void TraceError (const wxString & msg); + void TraceError(const wxString & msg); /** @@ -237,7 +237,7 @@ class Action * @return temporary filename */ svn::Path - GetPathAsTempFile ( + GetPathAsTempFile( const svn::Path & path, const svn::Revision & revision = svn::Revision::HEAD); @@ -249,12 +249,12 @@ class Action /** * private default constructor */ - Action (); + Action(); /** * private copy constructor */ - Action (const Action &); + Action(const Action &); }; #endif diff --git a/src/action_event.cpp b/src/action_event.cpp index c522e45b..3d7c312a 100644 --- a/src/action_event.cpp +++ b/src/action_event.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,73 +39,73 @@ struct ActionEvent::Data wxString msg; void * data; - Data (wxWindow * parent_, int eventId_) : - parent (parent_), eventId (eventId_) + Data(wxWindow * parent_, int eventId_) : + parent(parent_), eventId(eventId_) { - event = new wxCommandEvent (wxEVT_COMMAND_MENU_SELECTED, ACTION_EVENT); - event->SetInt (eventId); + event = new wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, ACTION_EVENT); + event->SetInt(eventId); } - ~Data () + ~Data() { delete event; } }; -ActionEvent::ActionEvent (wxWindow * parent, int eventId) - : m (NULL) +ActionEvent::ActionEvent(wxWindow * parent, int eventId) + : m(NULL) { - init (parent, eventId); + init(parent, eventId); } -ActionEvent::ActionEvent (wxWindow * parent, int eventId, const wxString & msg) - : m (NULL) +ActionEvent::ActionEvent(wxWindow * parent, int eventId, const wxString & msg) + : m(NULL) { - init (parent, eventId, msg); + init(parent, eventId, msg); // m->event->SetString (msg); } -ActionEvent::ActionEvent (wxWindow * parent, int eventId, void * data) - : m (NULL) +ActionEvent::ActionEvent(wxWindow * parent, int eventId, void * data) + : m(NULL) { - init (parent, eventId, data); + init(parent, eventId, data); // m->event->SetClientData (data); } -ActionEvent::~ActionEvent () +ActionEvent::~ActionEvent() { delete m; } void -ActionEvent::init (wxWindow * parent, int eventId) +ActionEvent::init(wxWindow * parent, int eventId) { if (m == NULL) { - m = new Data (parent, eventId); + m = new Data(parent, eventId); } else { - m->event->SetInt (eventId); - m->event->SetString (wxEmptyString); - m->event->SetClientData (NULL); + m->event->SetInt(eventId); + m->event->SetString(wxEmptyString); + m->event->SetClientData(NULL); } } void -ActionEvent::init (wxWindow * parent, int eventId, const wxString & msg) +ActionEvent::init(wxWindow * parent, int eventId, const wxString & msg) { - init (parent, eventId); - m->event->SetString (msg); - m->event->SetClientData (NULL); + init(parent, eventId); + m->event->SetString(msg); + m->event->SetClientData(NULL); } void -ActionEvent::init (wxWindow * parent, int eventId, void * data) +ActionEvent::init(wxWindow * parent, int eventId, void * data) { - init (parent, eventId); - m->event->SetClientData (data); - m->event->SetString (wxEmptyString); + init(parent, eventId); + m->event->SetClientData(data); + m->event->SetString(wxEmptyString); } // void @@ -127,30 +127,30 @@ ActionEvent::init (wxWindow * parent, int eventId, void * data) // } void -ActionEvent::Post () const +ActionEvent::Post() const { - wxPostEvent (m->parent, *m->event); + wxPostEvent(m->parent, *m->event); } void -ActionEvent::Post (wxWindow * parent, int event_id) +ActionEvent::Post(wxWindow * parent, int event_id) { - ActionEvent event (parent, event_id); - event.Post (); + ActionEvent event(parent, event_id); + event.Post(); } void -ActionEvent::Post (wxWindow * parent, int event_id, const wxString & msg) +ActionEvent::Post(wxWindow * parent, int event_id, const wxString & msg) { - ActionEvent event (parent, event_id, msg); - event.Post (); + ActionEvent event(parent, event_id, msg); + event.Post(); } void -ActionEvent::Post (wxWindow * parent, int event_id, void * data) +ActionEvent::Post(wxWindow * parent, int event_id, void * data) { - ActionEvent event (parent, event_id, data); - event.Post (); + ActionEvent event(parent, event_id, data); + event.Post(); } /* ----------------------------------------------------------------- diff --git a/src/action_event.hpp b/src/action_event.hpp index 5a501128..81c3bdd3 100644 --- a/src/action_event.hpp +++ b/src/action_event.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,7 +39,7 @@ class ActionEvent * @param parent parent window * @param event_id id of event */ - ActionEvent (wxWindow * parent, int event_id); + ActionEvent(wxWindow * parent, int event_id); /** * constructor @@ -48,7 +48,7 @@ class ActionEvent * @param event_id id of event * @param msg message event has to pass */ - ActionEvent (wxWindow * parent, int event_id, const wxString & msg); + ActionEvent(wxWindow * parent, int event_id, const wxString & msg); /** * constructor @@ -57,21 +57,21 @@ class ActionEvent * @param event_id id of event * @param data data event has to pass */ - ActionEvent (wxWindow * parent, int event_id, void * data); + ActionEvent(wxWindow * parent, int event_id, void * data); /** * destructor */ - virtual ~ActionEvent (); + virtual ~ActionEvent(); void - init (wxWindow * parent, int event_id); + init(wxWindow * parent, int event_id); void - init (wxWindow * parent, int event_id, const wxString & msg); + init(wxWindow * parent, int event_id, const wxString & msg); void - init (wxWindow * parent, int event_id, void * data); + init(wxWindow * parent, int event_id, void * data); // /** // * set the event code to be passed @@ -101,16 +101,16 @@ class ActionEvent * post the event */ void - Post () const; + Post() const; - static void - Post (wxWindow * parent, int event_id); + static void + Post(wxWindow * parent, int event_id); - static void - Post (wxWindow * parent, int event_id, const wxString & msg); + static void + Post(wxWindow * parent, int event_id, const wxString & msg); - static void - Post (wxWindow * parent, int event_id, void * data); + static void + Post(wxWindow * parent, int event_id, void * data); private: struct Data; @@ -119,16 +119,16 @@ class ActionEvent /** * forbid default constructor */ - ActionEvent (); + ActionEvent(); /** * forbid default copy constructor - */ - ActionEvent (const ActionEvent &); + */ + ActionEvent(const ActionEvent &); /** * forbid default assignment operator - */ + */ ActionEvent operator = (const ActionEvent &); }; diff --git a/src/action_factory.cpp b/src/action_factory.cpp index b4665589..1042c19a 100644 --- a/src/action_factory.cpp +++ b/src/action_factory.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -65,112 +65,112 @@ #include "drag_n_drop_action.hpp" #include "ignore_action.hpp" -bool -ActionFactory::CheckIdForStatusSel (int id, const svn::StatusSel & statusSel) +bool +ActionFactory::CheckIdForStatusSel(int id, const svn::StatusSel & statusSel) { bool result = true; if ((id >= ID_Verb_Min) && (id <= ID_Verb_Max)) - return ExternalProgramAction::CheckStatusSel (statusSel); - + return ExternalProgramAction::CheckStatusSel(statusSel); + switch (id) { case ID_Explore: // Special case of ExternalProgramAction - needs to be a working copy, not just single target - result = ExternalProgramAction::CheckStatusSel (statusSel); + result = ExternalProgramAction::CheckStatusSel(statusSel); break; case ID_Default_Action: - result = ExternalProgramAction::CheckStatusSel (statusSel); + result = ExternalProgramAction::CheckStatusSel(statusSel); break; case ID_Update: - result = UpdateAction::CheckStatusSel (statusSel); + result = UpdateAction::CheckStatusSel(statusSel); break; case ID_Commit: - result = CommitAction::CheckStatusSel (statusSel); + result = CommitAction::CheckStatusSel(statusSel); break; case ID_Add: - result = AddAction::CheckStatusSel (statusSel); + result = AddAction::CheckStatusSel(statusSel); break; case ID_AddRecursive: - result = AddAction::CheckStatusSel (statusSel); + result = AddAction::CheckStatusSel(statusSel); break; case ID_Import: - result = ImportAction::CheckStatusSel (statusSel); + result = ImportAction::CheckStatusSel(statusSel); break; case ID_Export: - result = ExportAction::CheckStatusSel (statusSel); + result = ExportAction::CheckStatusSel(statusSel); break; case ID_Checkout: - result = CheckoutAction::CheckStatusSel (statusSel); + result = CheckoutAction::CheckStatusSel(statusSel); break; case ID_Cleanup: - result = CleanupAction::CheckStatusSel (statusSel); + result = CleanupAction::CheckStatusSel(statusSel); break; case ID_Lock: - result = LockAction::CheckStatusSel (statusSel); + result = LockAction::CheckStatusSel(statusSel); break; case ID_Log: - result = LogAction::CheckStatusSel (statusSel); + result = LogAction::CheckStatusSel(statusSel); break; case ID_Revert: - result = RevertAction::CheckStatusSel (statusSel); + result = RevertAction::CheckStatusSel(statusSel); break; case ID_UserResolve: - result = UserResolveAction::CheckStatusSel (statusSel); + result = UserResolveAction::CheckStatusSel(statusSel); break; case ID_Resolve: - result = ResolveAction::CheckStatusSel (statusSel); + result = ResolveAction::CheckStatusSel(statusSel); break; case ID_Delete: - result = DeleteAction::CheckStatusSel (statusSel); + result = DeleteAction::CheckStatusSel(statusSel); break; case ID_Copy: - result = MoveAction::CheckStatusSel (statusSel); + result = MoveAction::CheckStatusSel(statusSel); break; case ID_Move: - result = MoveAction::CheckStatusSel (statusSel); + result = MoveAction::CheckStatusSel(statusSel); break; case ID_Mkdir: - result = MkdirAction::CheckStatusSel (statusSel); + result = MkdirAction::CheckStatusSel(statusSel); break; case ID_Merge: - result = MergeAction::CheckStatusSel (statusSel); + result = MergeAction::CheckStatusSel(statusSel); break; case ID_Property: - result = PropertyAction::CheckStatusSel (statusSel); + result = PropertyAction::CheckStatusSel(statusSel); break; case ID_Rename: - result = RenameAction::CheckStatusSel (statusSel); + result = RenameAction::CheckStatusSel(statusSel); break; case ID_Switch: - result = SwitchAction::CheckStatusSel (statusSel); + result = SwitchAction::CheckStatusSel(statusSel); break; case ID_Diff: case ID_DiffBase: case ID_DiffHead: - result = DiffAction::CheckStatusSel (statusSel); + result = DiffAction::CheckStatusSel(statusSel); break; case ID_Info: @@ -179,18 +179,18 @@ ActionFactory::CheckIdForStatusSel (int id, const svn::StatusSel & statusSel) break; case ID_Unlock: - result = UnlockAction::CheckStatusSel (statusSel); + result = UnlockAction::CheckStatusSel(statusSel); break; case ID_Edit: - result = ViewAction::CheckStatusSel (statusSel); + result = ViewAction::CheckStatusSel(statusSel); break; case ID_Annotate: - result = AnnotateAction::CheckStatusSel (statusSel); + result = AnnotateAction::CheckStatusSel(statusSel); break; case ID_Ignore: - result = IgnoreAction::CheckStatusSel (statusSel); + result = IgnoreAction::CheckStatusSel(statusSel); break; }; @@ -199,20 +199,20 @@ ActionFactory::CheckIdForStatusSel (int id, const svn::StatusSel & statusSel) Action * -ActionFactory::CreateAction (wxWindow * parent, int id) +ActionFactory::CreateAction(wxWindow * parent, int id) { Action* action = NULL; if ((id >= ID_Verb_Min) && (id <= ID_Verb_Max)) { - action = new ExternalProgramAction (parent, id - ID_Verb_Min, false); + action = new ExternalProgramAction(parent, id - ID_Verb_Min, false); } else { switch (id) { case ID_Explore: - action = new ExternalProgramAction (parent, -1, true); + action = new ExternalProgramAction(parent, -1, true); break; case ID_Update: @@ -224,111 +224,111 @@ ActionFactory::CreateAction (wxWindow * parent, int id) break; case ID_Add: - action = new AddAction (parent); + action = new AddAction(parent); break; case ID_AddRecursive: - action = new AddAction (parent, true); + action = new AddAction(parent, true); break; case ID_Import: - action = new ImportAction (parent); + action = new ImportAction(parent); break; case ID_Export: - action = new ExportAction (parent); + action = new ExportAction(parent); break; case ID_Checkout: - action = new CheckoutAction (parent); + action = new CheckoutAction(parent); break; case ID_Cleanup: - action = new CleanupAction (parent); + action = new CleanupAction(parent); break; case ID_Lock: - action = new LockAction (parent); + action = new LockAction(parent); break; case ID_Log: - action = new LogAction (parent); + action = new LogAction(parent); break; case ID_Revert: - action = new RevertAction (parent); + action = new RevertAction(parent); break; case ID_UserResolve: - action = new UserResolveAction (parent); + action = new UserResolveAction(parent); break; case ID_Resolve: - action = new ResolveAction (parent); + action = new ResolveAction(parent); break; case ID_Delete: - action = new DeleteAction (parent); + action = new DeleteAction(parent); break; case ID_Copy: - action = new MoveAction (parent, MOVE_COPY); + action = new MoveAction(parent, MOVE_COPY); break; case ID_Move: - action = new MoveAction (parent, MOVE_MOVE); + action = new MoveAction(parent, MOVE_MOVE); break; case ID_Merge: - action = new MergeAction (parent); + action = new MergeAction(parent); break; case ID_Property: - action = new PropertyAction (parent); + action = new PropertyAction(parent); break; case ID_Rename: - action = new RenameAction (parent); + action = new RenameAction(parent); break; case ID_Switch: - action = new SwitchAction (parent); + action = new SwitchAction(parent); break; case ID_Diff: - action = new DiffAction (parent); + action = new DiffAction(parent); break; case ID_DiffBase: - { - DiffData data (svn::Revision::BASE); - action = new DiffAction (parent, data); - break; - } + { + DiffData data(svn::Revision::BASE); + action = new DiffAction(parent, data); + break; + } case ID_DiffHead: - { - DiffData data (svn::Revision::HEAD); - action = new DiffAction (parent, data); - break; - } + { + DiffData data(svn::Revision::HEAD); + action = new DiffAction(parent, data); + break; + } case ID_Unlock: - action = new UnlockAction (parent); + action = new UnlockAction(parent); break; case ID_Edit: - action = new ViewAction (parent); + action = new ViewAction(parent); break; case ID_Annotate: - { - AnnotateData data; - action = new AnnotateAction (parent, data); - break; - } + { + AnnotateData data; + action = new AnnotateAction(parent, data); + break; + } case ID_Ignore: - action = new IgnoreAction (parent); + action = new IgnoreAction(parent); break; } } diff --git a/src/action_factory.hpp b/src/action_factory.hpp index 884543c6..9baf5f2b 100644 --- a/src/action_factory.hpp +++ b/src/action_factory.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,13 +36,13 @@ namespace svn /** * this is a factory class that checks, whether * an @ref Action for a @a id is valid and next, - * creates a new @ref Action instance (an inherited + * creates a new @ref Action instance (an inherited * @ref Action of course, like @ref CheckoutAction */ class ActionFactory { public: - /** + /** * check whether the selection of @a statusSel can * be used for the action identified by @a id * @@ -50,8 +50,8 @@ class ActionFactory * @param targets * @retval true valid */ - static bool - CheckIdForStatusSel (int id, const svn::StatusSel & statusSel); + static bool + CheckIdForStatusSel(int id, const svn::StatusSel & statusSel); /** @@ -63,7 +63,7 @@ class ActionFactory * @param id the id of the action */ static Action * - CreateAction (wxWindow * parent, int id); + CreateAction(wxWindow * parent, int id); }; diff --git a/src/action_worker.hpp b/src/action_worker.hpp index d70deb09..6fe212c8 100644 --- a/src/action_worker.hpp +++ b/src/action_worker.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -67,8 +67,8 @@ class ActionWorker * @param parent parent window * @param the tracer that will receive notifications */ - virtual void - Create (wxWindow * parent) = 0; + virtual void + Create(wxWindow * parent) = 0; /** * check if there is already an action @@ -76,8 +76,8 @@ class ActionWorker * * @return true=active / false=inactive */ - virtual ActionState - GetState () = 0; + virtual ActionState + GetState() = 0; /** * returns the result of the action @@ -86,8 +86,8 @@ class ActionWorker * * @return result of the last action */ - virtual ActionResult - GetResult () = 0; + virtual ActionResult + GetResult() = 0; /** * sets the tracer that will be notified @@ -98,8 +98,8 @@ class ActionWorker * * @param tracer */ - virtual void - SetTracer (Tracer * tr) = 0; + virtual void + SetTracer(Tracer * tr) = 0; /** * Used to run an Action. If there @@ -112,8 +112,8 @@ class ActionWorker * @param action Action to run * @return true=success/false=another action running */ - virtual bool - Perform (Action * action) = 0; + virtual bool + Perform(Action * action) = 0; /** * Sets the context to use for actions @@ -122,15 +122,15 @@ class ActionWorker * @param own true: this class will own and delete the worker */ virtual void - SetContext (svn::Context * context, bool own = false) = 0; + SetContext(svn::Context * context, bool own = false) = 0; /** * @return the context */ - virtual svn::Context * - GetContext () const = 0; + virtual svn::Context * + GetContext() const = 0; - virtual ~ActionWorker () { } + virtual ~ActionWorker() { } }; #endif diff --git a/src/add_action.cpp b/src/add_action.cpp index cdceb61f..2da221c4 100644 --- a/src/add_action.cpp +++ b/src/add_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,43 +39,43 @@ struct AddAction::Data public: bool recursive; - Data (bool recursive_) - : recursive (recursive_) + Data(bool recursive_) + : recursive(recursive_) { } }; -AddAction::AddAction (wxWindow * parent, bool recursive) - : Action (parent, _("Add"), 0), - m (new Data (recursive)) +AddAction::AddAction(wxWindow * parent, bool recursive) + : Action(parent, _("Add"), 0), + m(new Data(recursive)) { } -AddAction::~AddAction () +AddAction::~AddAction() { delete m; } bool -AddAction::Prepare () +AddAction::Prepare() { // No dialog for Add - return Action::Prepare (); + return Action::Prepare(); } bool -AddAction::Perform () +AddAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); - const std::vector & v = GetTargets ().targets (); + const std::vector & v = GetTargets().targets(); std::vector::const_iterator it; - for (it = v.begin (); it != v.end (); it++) + for (it = v.begin(); it != v.end(); it++) { const svn::Path & path = *it; - client.add (path.c_str (), m->recursive); + client.add(path.c_str(), m->recursive); } return true; @@ -83,15 +83,15 @@ AddAction::Perform () bool -AddAction::CheckStatusSel (const svn::StatusSel & statusSel) +AddAction::CheckStatusSel(const svn::StatusSel & statusSel) { - if (0 == statusSel.size ()) + if (0 == statusSel.size()) return false; - if (statusSel.hasUrl ()) + if (statusSel.hasUrl()) return false; - if (statusSel.hasVersioned ()) + if (statusSel.hasVersioned()) return false; return true; diff --git a/src/add_action.hpp b/src/add_action.hpp index e7ab9a23..eb9e1a19 100644 --- a/src/add_action.hpp +++ b/src/add_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -45,17 +45,17 @@ class AddAction:public Action * @param parent parent window * @param recursive if true, add files/directories recursive */ - AddAction (wxWindow * parent, bool recursive=false); - virtual ~AddAction (); + AddAction(wxWindow * parent, bool recursive=false); + virtual ~AddAction(); - virtual bool - Prepare (); + virtual bool + Prepare(); - virtual bool - Perform (); + virtual bool + Perform(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: struct Data; diff --git a/src/annotate_action.cpp b/src/annotate_action.cpp index db3602ab..5854e6e6 100644 --- a/src/annotate_action.cpp +++ b/src/annotate_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,7 +39,7 @@ #include "utils.hpp" #include "annotate_action.hpp" -struct AnnotateAction::Data +struct AnnotateAction::Data { private: Action * action; @@ -48,108 +48,108 @@ struct AnnotateAction::Data AnnotateData data; wxWindow * parent; - Data (Action * action_) - : action (action_) + Data(Action * action_) + : action(action_) { } - Data (Action * action_, AnnotateData & data_) - : action (action_), data (data_) + Data(Action * action_, AnnotateData & data_) + : action(action_), data(data_) { } - svn::Context * - GetContext () + svn::Context * + GetContext() { - return action->GetContext (); + return action->GetContext(); } svn::AnnotatedFile * - GetAnnotatedFile (svn::Path path) + GetAnnotatedFile(svn::Path path) { - svn::Client client (GetContext ()); - svn::AnnotatedFile * annotatedFile = client.annotate (path, - data.startRevision, data.endRevision); + svn::Client client(GetContext()); + svn::AnnotatedFile * annotatedFile = client.annotate(path, + data.startRevision, data.endRevision); return annotatedFile; } }; -AnnotateAction::AnnotateAction (wxWindow * parent, - const AnnotateData & data) - : Action (parent, _("Annotate"), UPDATE_LATER), - dlg (parent, _("Annotate")) +AnnotateAction::AnnotateAction(wxWindow * parent, + const AnnotateData & data) + : Action(parent, _("Annotate"), UPDATE_LATER), + dlg(parent, _("Annotate")) { - m = new Data (this); + m = new Data(this); m->parent = parent; m->data = data; } -AnnotateAction::~AnnotateAction () +AnnotateAction::~AnnotateAction() { delete m; } bool -AnnotateAction::Prepare () +AnnotateAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } { // Busy cursor scope wxBusyCursor busyCursor; - + // Now Annotate // If the data's path variable is set, then use that value // Otherwise use the value of GetTarget() // The data's path variable is set on the log dialog svn::AnnotatedFile * annotatedFile = NULL; svn::Path path; - if (m->data.path.IsEmpty ()) + if (m->data.path.IsEmpty()) { - path = GetTarget (); + path = GetTarget(); } else { - path = PathUtf8 (m->data.path); + path = PathUtf8(m->data.path); } - annotatedFile = m->GetAnnotatedFile (path); + annotatedFile = m->GetAnnotatedFile(path); svn::AnnotatedFile::const_iterator it; - for (it=annotatedFile->begin (); it!=annotatedFile->end (); it++) + for (it=annotatedFile->begin(); it!=annotatedFile->end(); it++) { - svn::AnnotateLine line (*it); - dlg.AddAnnotateLine (line.revision (), Utf8ToLocal (line.author ()), - Utf8ToLocal (line.line ())); + svn::AnnotateLine line(*it); + dlg.AddAnnotateLine(line.revision(), Utf8ToLocal(line.author()), + Utf8ToLocal(line.line())); } - dlg.AutoSizeColumn (); + dlg.AutoSizeColumn(); delete annotatedFile; } - dlg.ShowModal (); + dlg.ShowModal(); return true; } bool -AnnotateAction::Perform () +AnnotateAction::Perform() { return true; } bool -AnnotateAction::CheckStatusSel (const svn::StatusSel & statusSel) +AnnotateAction::CheckStatusSel(const svn::StatusSel & statusSel) { - if (statusSel.size () != 1) + if (statusSel.size() != 1) return false; - if (statusSel.hasUnversioned ()) + if (statusSel.hasUnversioned()) return false; - if (statusSel.hasDirs ()) + if (statusSel.hasDirs()) return false; return true; diff --git a/src/annotate_action.hpp b/src/annotate_action.hpp index 4e197faa..094a2baf 100644 --- a/src/annotate_action.hpp +++ b/src/annotate_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,8 +36,8 @@ namespace svn } /** - * This action downloads a specific revision - * of a file (specified in @a GetData) and + * This action downloads a specific revision + * of a file (specified in @a GetData) and * displays the file */ class AnnotateAction:public Action @@ -52,20 +52,20 @@ class AnnotateAction:public Action * @param parent parent window * @param data update data */ - AnnotateAction (wxWindow * parent, - const AnnotateData & data); + AnnotateAction(wxWindow * parent, + const AnnotateData & data); /** Desctructor */ - virtual ~AnnotateAction (); + virtual ~AnnotateAction(); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: diff --git a/src/annotate_data.hpp b/src/annotate_data.hpp index d682ad02..2fd3cde7 100644 --- a/src/annotate_data.hpp +++ b/src/annotate_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,9 +39,9 @@ struct AnnotateData svn::Revision endRevision; /** Constructor */ - AnnotateData () - : startRevision (svn::Revision::START), - endRevision (svn::Revision::HEAD) + AnnotateData() + : startRevision(svn::Revision::START), + endRevision(svn::Revision::HEAD) { } }; diff --git a/src/annotate_dlg.cpp b/src/annotate_dlg.cpp index 0bd8dc04..4d4edf55 100644 --- a/src/annotate_dlg.cpp +++ b/src/annotate_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -30,96 +30,96 @@ #include "annotate_dlg.hpp" #include "utils.hpp" -BEGIN_EVENT_TABLE (AnnotateDlg, wxDialog) - EVT_BUTTON (-1, AnnotateDlg::OnButton) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(AnnotateDlg, wxDialog) + EVT_BUTTON(-1, AnnotateDlg::OnButton) +END_EVENT_TABLE() -AnnotateDlg::AnnotateDlg (wxWindow * parent, - const wxString & caption) - : wxDialog (parent, -1, caption, wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxMAXIMIZE_BOX | wxRESIZE_BORDER) +AnnotateDlg::AnnotateDlg(wxWindow * parent, + const wxString & caption) + : wxDialog(parent, -1, caption, wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxMAXIMIZE_BOX | wxRESIZE_BORDER) { - m_button = new wxButton (this, wxID_OK, _("OK")); + m_button = new wxButton(this, wxID_OK, _("OK")); - m_list = new wxListView (this, -1, wxDefaultPosition, wxSize (565, 450), - wxLC_REPORT); + m_list = new wxListView(this, -1, wxDefaultPosition, wxSize(565, 450), + wxLC_REPORT); - m_list->InsertColumn (0, _("Revision"), wxLIST_FORMAT_RIGHT); - m_list->InsertColumn (1, _("Author"), wxLIST_FORMAT_RIGHT); - m_list->InsertColumn (2, _("Line"), wxLIST_FORMAT_RIGHT); - m_list->InsertColumn (3, wxT("")); // Empty spacer column - m_list->InsertColumn (4, wxT("")); + m_list->InsertColumn(0, _("Revision"), wxLIST_FORMAT_RIGHT); + m_list->InsertColumn(1, _("Author"), wxLIST_FORMAT_RIGHT); + m_list->InsertColumn(2, _("Line"), wxLIST_FORMAT_RIGHT); + m_list->InsertColumn(3, wxT("")); // Empty spacer column + m_list->InsertColumn(4, wxT("")); // On Windows, the first column isn't properly right aligned // in the previous InsertColumn call. Here we set it again // to be sure that it is right aligned wxListItem item; - m_list->GetColumn (0, item); - item.SetAlign (wxLIST_FORMAT_RIGHT); - m_list->SetColumn (0, item); + m_list->GetColumn(0, item); + item.SetAlign(wxLIST_FORMAT_RIGHT); + m_list->SetColumn(0, item); - m_list->SetColumnWidth (0, 75); - m_list->SetColumnWidth (1, 100); - m_list->SetColumnWidth (2, 50); - m_list->SetColumnWidth (3, 10); - m_list->SetColumnWidth (4, 150); + m_list->SetColumnWidth(0, 75); + m_list->SetColumnWidth(1, 100); + m_list->SetColumnWidth(2, 50); + m_list->SetColumnWidth(3, 10); + m_list->SetColumnWidth(4, 150); - wxBoxSizer * topsizer = new wxBoxSizer (wxVERTICAL); + wxBoxSizer * topsizer = new wxBoxSizer(wxVERTICAL); - topsizer->Add (m_list, 1, // make vertically stretchable - wxEXPAND | // make horizontally stretchable - wxALL, // and make border all around - 5); // set border width to 10 + topsizer->Add(m_list, 1, // make vertically stretchable + wxEXPAND | // make horizontally stretchable + wxALL, // and make border all around + 5); // set border width to 10 - wxBoxSizer * button_sizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer * button_sizer = new wxBoxSizer(wxHORIZONTAL); - button_sizer->Add (m_button, 0, // make horizontally unstretchable - wxALL, // make border all around (implicit top alignment) - 5); // set border width to 10 + button_sizer->Add(m_button, 0, // make horizontally unstretchable + wxALL, // make border all around (implicit top alignment) + 5); // set border width to 10 - topsizer->Add (button_sizer, 0, // make vertically unstretchable - wxALIGN_CENTER); // no border and centre horizontally + topsizer->Add(button_sizer, 0, // make vertically unstretchable + wxALIGN_CENTER); // no border and centre horizontally - SetAutoLayout (TRUE); // tell dialog to use sizer - SetSizer (topsizer); // actually set the sizer + SetAutoLayout(TRUE); // tell dialog to use sizer + SetSizer(topsizer); // actually set the sizer - topsizer->Fit (this); // set size to minimum size as calculated by the sizer - topsizer->SetSizeHints (this); // set size hints to honour mininum size + topsizer->Fit(this); // set size to minimum size as calculated by the sizer + topsizer->SetSizeHints(this); // set size hints to honour mininum size - Maximize (); + Maximize(); } void -AnnotateDlg::OnButton (wxCommandEvent & event) +AnnotateDlg::OnButton(wxCommandEvent & event) { - event.Skip (); + event.Skip(); } void -AnnotateDlg::AddAnnotateLine (int revision, const wxString & author, - const wxString & line) +AnnotateDlg::AddAnnotateLine(int revision, const wxString & author, + const wxString & line) { - int index = m_list->GetItemCount (); - wxString rev = wxString::Format (wxT("%ld"), (long) revision); + int index = m_list->GetItemCount(); + wxString rev = wxString::Format(wxT("%ld"), (long) revision); - m_list->InsertItem (index, rev); - m_list->SetItem (index, 1, author); - m_list->SetItem (index, 2, wxString::Format (wxT("%ld"), (long) index + 1)); - m_list->SetItem (index, 3, wxT("")); + m_list->InsertItem(index, rev); + m_list->SetItem(index, 1, author); + m_list->SetItem(index, 2, wxString::Format(wxT("%ld"), (long) index + 1)); + m_list->SetItem(index, 3, wxT("")); // Windows displays the link breaks as squares. Format the line // to avoid that wxString formattedLine = line; - formattedLine.Replace (wxT("\r"), wxT("")); - formattedLine.Replace (wxT("\n"), wxT("")); - formattedLine.Replace (wxT("\t"), wxT(" ")); - m_list->SetItem (index, 4, formattedLine); + formattedLine.Replace(wxT("\r"), wxT("")); + formattedLine.Replace(wxT("\n"), wxT("")); + formattedLine.Replace(wxT("\t"), wxT(" ")); + m_list->SetItem(index, 4, formattedLine); } void -AnnotateDlg::AutoSizeColumn () +AnnotateDlg::AutoSizeColumn() { - m_list->SetColumnWidth (4, wxLIST_AUTOSIZE); + m_list->SetColumnWidth(4, wxLIST_AUTOSIZE); } /* ----------------------------------------------------------------- diff --git a/src/annotate_dlg.hpp b/src/annotate_dlg.hpp index 7ef06337..22d027d8 100644 --- a/src/annotate_dlg.hpp +++ b/src/annotate_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,19 +34,19 @@ class wxListView; class AnnotateDlg:public wxDialog { public: - AnnotateDlg (wxWindow * parent, - const wxString & caption); + AnnotateDlg(wxWindow * parent, + const wxString & caption); - void OnButton (wxCommandEvent & event); - void AddAnnotateLine (int revision, const wxString & author, - const wxString & line); - void AutoSizeColumn (); + void OnButton(wxCommandEvent & event); + void AddAnnotateLine(int revision, const wxString & author, + const wxString & line); + void AutoSizeColumn(); private: wxButton *m_button; wxListView *m_list; - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/auth_dlg.cpp b/src/auth_dlg.cpp index 3d6ec665..38ef06cb 100644 --- a/src/auth_dlg.cpp +++ b/src/auth_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -30,8 +30,8 @@ // app #include "auth_dlg.hpp" -BEGIN_EVENT_TABLE (AuthDlg, wxDialog) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(AuthDlg, wxDialog) +END_EVENT_TABLE() struct AuthDlg::Data { @@ -39,7 +39,7 @@ struct AuthDlg::Data wxString Username; wxString Password; - Data (wxWindow * window, int flags) + Data(wxWindow * window, int flags) { wxStaticText * labelUser=0; wxTextCtrl * textUser=0; @@ -51,60 +51,60 @@ struct AuthDlg::Data if (showUser) { labelUser = - new wxStaticText (window, -1, _("User")); + new wxStaticText(window, -1, _("User")); - textUser = new wxTextCtrl ( + textUser = new wxTextCtrl( window, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, - wxTextValidator (wxFILTER_NONE, &Username)); + wxTextValidator(wxFILTER_NONE, &Username)); } wxStaticText * labelPassword = - new wxStaticText (window, -1, _("Password")); + new wxStaticText(window, -1, _("Password")); - wxTextCtrl* textPassword = new wxTextCtrl ( + wxTextCtrl* textPassword = new wxTextCtrl( window, -1, wxEmptyString, wxPoint(-1,-1), wxDefaultSize, wxTE_PASSWORD, - wxTextValidator (wxFILTER_NONE, &Password)); + wxTextValidator(wxFILTER_NONE, &Password)); // buttons - wxButton * buttonOk = new wxButton (window, wxID_OK, - _("OK")); - wxButton * buttonCancel = new wxButton (window, wxID_CANCEL, - _("Cancel")); + wxButton * buttonOk = new wxButton(window, wxID_OK, + _("OK")); + wxButton * buttonCancel = new wxButton(window, wxID_CANCEL, + _("Cancel")); // create sizers and position controls wxFlexGridSizer *authSizer = new wxFlexGridSizer(2, 2, 5, 5); if (showUser) { - authSizer->Add (labelUser, 0, - wxLEFT | wxALIGN_CENTER_VERTICAL, 5); + authSizer->Add(labelUser, 0, + wxLEFT | wxALIGN_CENTER_VERTICAL, 5); - authSizer->Add (textUser, 1, - wxALL | wxALIGN_CENTER_VERTICAL | wxEXPAND, 5); + authSizer->Add(textUser, 1, + wxALL | wxALIGN_CENTER_VERTICAL | wxEXPAND, 5); } - authSizer->Add (labelPassword, 0, + authSizer->Add(labelPassword, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 5); - authSizer->Add (textPassword, 1, + authSizer->Add(textPassword, 1, wxALL | wxALIGN_CENTER_VERTICAL, 5); // The buttons: - wxBoxSizer *buttonSizer = new wxBoxSizer (wxHORIZONTAL); - buttonSizer->Add (buttonOk, 0, wxALL, 10); - buttonSizer->Add (buttonCancel, 0, wxALL, 10); - buttonOk->SetDefault (); + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); + buttonSizer->Add(buttonOk, 0, wxALL, 10); + buttonSizer->Add(buttonCancel, 0, wxALL, 10); + buttonOk->SetDefault(); // Add all the sizers to the main sizer - wxBoxSizer *mainSizer = new wxBoxSizer (wxVERTICAL); - mainSizer->Add (authSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); + wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(authSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); - window->SetAutoLayout (true); - window->SetSizer (mainSizer); + window->SetAutoLayout(true); + window->SetSizer(mainSizer); - mainSizer->SetSizeHints (window); - mainSizer->Fit (window); + mainSizer->SetSizeHints(window); + mainSizer->Fit(window); } }; @@ -112,29 +112,29 @@ struct AuthDlg::Data const int AuthDlg::HIDE_USERNAME = 1; // TODO: username & password are not used - why not? -AuthDlg::AuthDlg (wxWindow* parent, const wxString & username, - const wxString & password, int flags) -: wxDialog (parent, -1, _("Authentication"), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +AuthDlg::AuthDlg(wxWindow* parent, const wxString & username, + const wxString & password, int flags) + : wxDialog(parent, -1, _("Authentication"), + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - m = new Data (this, flags); - CentreOnParent (); + m = new Data(this, flags); + CentreOnParent(); } -AuthDlg::~AuthDlg () +AuthDlg::~AuthDlg() { delete m; } const wxString & -AuthDlg::GetUsername () const +AuthDlg::GetUsername() const { return m->Username; } const wxString & -AuthDlg::GetPassword () const +AuthDlg::GetPassword() const { return m->Password; } diff --git a/src/auth_dlg.hpp b/src/auth_dlg.hpp index 05b7d1e8..801ae50a 100644 --- a/src/auth_dlg.hpp +++ b/src/auth_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -32,24 +32,24 @@ class AuthDlg:public wxDialog public: static const int HIDE_USERNAME; - AuthDlg (wxWindow * parent, - const wxString & username = wxEmptyString, - const wxString & password = wxEmptyString, - int flags = 0); + AuthDlg(wxWindow * parent, + const wxString & username = wxEmptyString, + const wxString & password = wxEmptyString, + int flags = 0); - virtual ~AuthDlg (); + virtual ~AuthDlg(); const wxString & - GetUsername () const; + GetUsername() const; const wxString & - GetPassword () const; + GetPassword() const; private: struct Data; Data * m; - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/cert_dlg.cpp b/src/cert_dlg.cpp index 7628356a..6e23f648 100644 --- a/src/cert_dlg.cpp +++ b/src/cert_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,10 +36,10 @@ enum }; -BEGIN_EVENT_TABLE (CertDlg, wxDialog) - EVT_BUTTON (ID_PERM, CertDlg::OnPerm) - EVT_BUTTON (ID_TEMP, CertDlg::OnTemp) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(CertDlg, wxDialog) + EVT_BUTTON(ID_PERM, CertDlg::OnPerm) + EVT_BUTTON(ID_TEMP, CertDlg::OnTemp) +END_EVENT_TABLE() typedef struct @@ -55,18 +55,18 @@ struct CertDlg::Data svn::ContextListener::SslServerTrustAnswer answer; wxUint32 acceptedFailures; - Data (wxUint32 acceptedFailures_) - : answer (svn::ContextListener::DONT_ACCEPT), acceptedFailures (acceptedFailures_) + Data(wxUint32 acceptedFailures_) + : answer(svn::ContextListener::DONT_ACCEPT), acceptedFailures(acceptedFailures_) { } }; -CertDlg::CertDlg (wxWindow * parent, - const svn::ContextListener::SslServerTrustData & trustData) - : wxDialog (parent, -1, _("SSL Certificate"), wxDefaultPosition), - m (new Data (trustData.failures)) +CertDlg::CertDlg(wxWindow * parent, + const svn::ContextListener::SslServerTrustData & trustData) + : wxDialog(parent, -1, _("SSL Certificate"), wxDefaultPosition), + m(new Data(trustData.failures)) { - wxStaticText * labelTitle = new wxStaticText ( + wxStaticText * labelTitle = new wxStaticText( this, -1, _("There were errors validating the server certificate.\nDo you want to trust this certificate?")); wxString failureStr; @@ -80,7 +80,7 @@ CertDlg::CertDlg (wxWindow * parent, {SVN_AUTH_SSL_OTHER , _("- The certificate has an unknown error.")} }; - const int count = sizeof (CERT_FAILURES)/sizeof (CERT_FAILURES[0]); + const int count = sizeof(CERT_FAILURES)/sizeof(CERT_FAILURES[0]); for (int i=0; i < count; i++) { if ((CERT_FAILURES[i].failure & trustData.failures) != 0) @@ -90,60 +90,60 @@ CertDlg::CertDlg (wxWindow * parent, } } - wxStaticText * labelFailure = new wxStaticText ( + wxStaticText * labelFailure = new wxStaticText( this, -1, failureStr); - wxString failBoxLabel, tmp (Utf8ToLocal (trustData.realm)); - failBoxLabel.Printf (_("Error validating server certificate for '%s':"), - tmp.c_str ()); - wxStaticBox * failBox = new wxStaticBox ( + wxString failBoxLabel, tmp(Utf8ToLocal(trustData.realm)); + failBoxLabel.Printf(_("Error validating server certificate for '%s':"), + tmp.c_str()); + wxStaticBox * failBox = new wxStaticBox( this, -1, failBoxLabel); wxStaticBoxSizer * failBoxSizer = - new wxStaticBoxSizer (failBox, wxVERTICAL); - failBoxSizer->Add (labelFailure, 0, wxALL, 10); - - wxFlexGridSizer * certSizer = new wxFlexGridSizer (2, 10, 10); - certSizer->Add (new wxStaticText ( - this, -1, _("Hostname:"))); - certSizer->Add (new wxStaticText ( - this, -1, Utf8ToLocal (trustData.hostname.c_str ()))); - certSizer->Add (new wxStaticText ( - this, -1, _("Issue:"))); - certSizer->Add (new wxStaticText ( - this, -1, Utf8ToLocal (trustData.issuerDName.c_str ()))); - certSizer->Add (new wxStaticText ( - this, -1, _("Valid from:"))); - certSizer->Add (new wxStaticText ( - this, -1, Utf8ToLocal (trustData.validFrom.c_str ()))); - certSizer->Add (new wxStaticText ( - this, -1, _("Valid until:"))); - certSizer->Add (new wxStaticText ( - this, -1, Utf8ToLocal (trustData.validUntil.c_str ()))); - certSizer->Add (new wxStaticText ( - this, -1, _("Fingerprint:"))); - certSizer->Add (new wxStaticText ( - this, -1, Utf8ToLocal (trustData.fingerprint.c_str ()))); - - wxStaticBox * certBox = new wxStaticBox ( + new wxStaticBoxSizer(failBox, wxVERTICAL); + failBoxSizer->Add(labelFailure, 0, wxALL, 10); + + wxFlexGridSizer * certSizer = new wxFlexGridSizer(2, 10, 10); + certSizer->Add(new wxStaticText( + this, -1, _("Hostname:"))); + certSizer->Add(new wxStaticText( + this, -1, Utf8ToLocal(trustData.hostname.c_str()))); + certSizer->Add(new wxStaticText( + this, -1, _("Issue:"))); + certSizer->Add(new wxStaticText( + this, -1, Utf8ToLocal(trustData.issuerDName.c_str()))); + certSizer->Add(new wxStaticText( + this, -1, _("Valid from:"))); + certSizer->Add(new wxStaticText( + this, -1, Utf8ToLocal(trustData.validFrom.c_str()))); + certSizer->Add(new wxStaticText( + this, -1, _("Valid until:"))); + certSizer->Add(new wxStaticText( + this, -1, Utf8ToLocal(trustData.validUntil.c_str()))); + certSizer->Add(new wxStaticText( + this, -1, _("Fingerprint:"))); + certSizer->Add(new wxStaticText( + this, -1, Utf8ToLocal(trustData.fingerprint.c_str()))); + + wxStaticBox * certBox = new wxStaticBox( this, -1, _("Certificate Information:")); wxStaticBoxSizer * certBoxSizer = - new wxStaticBoxSizer (certBox, wxVERTICAL); - certBoxSizer->Add (certSizer); - - wxBoxSizer * buttonSizer = new wxBoxSizer (wxHORIZONTAL); - buttonSizer->Add (new wxButton (this, ID_PERM, _("&Permanently")), - 0, wxALL, 5); - buttonSizer->Add (new wxButton (this, ID_TEMP, _("&Temporarily")), - 0, wxALL, 5); - buttonSizer->Add (new wxButton (this, wxID_CANCEL, _("Cancel")), - 0, wxALL, 5); - - wxBoxSizer * mainSizer = new wxBoxSizer (wxVERTICAL); - mainSizer->Add (labelTitle, 0, wxALL, 5); - mainSizer->Add (failBoxSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (certBoxSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (buttonSizer, 0, - wxALL | wxALIGN_CENTER_HORIZONTAL, 5); + new wxStaticBoxSizer(certBox, wxVERTICAL); + certBoxSizer->Add(certSizer); + + wxBoxSizer * buttonSizer = new wxBoxSizer(wxHORIZONTAL); + buttonSizer->Add(new wxButton(this, ID_PERM, _("&Permanently")), + 0, wxALL, 5); + buttonSizer->Add(new wxButton(this, ID_TEMP, _("&Temporarily")), + 0, wxALL, 5); + buttonSizer->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), + 0, wxALL, 5); + + wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(labelTitle, 0, wxALL, 5); + mainSizer->Add(failBoxSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(certBoxSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(buttonSizer, 0, + wxALL | wxALIGN_CENTER_HORIZONTAL, 5); SetAutoLayout(true); SetSizer(mainSizer); @@ -151,41 +151,41 @@ CertDlg::CertDlg (wxWindow * parent, mainSizer->SetSizeHints(this); mainSizer->Fit(this); - CentreOnParent (); + CentreOnParent(); } -CertDlg::~CertDlg () +CertDlg::~CertDlg() { delete m; } void -CertDlg::OnPerm (wxCommandEvent & event) +CertDlg::OnPerm(wxCommandEvent & event) { m->answer = svn::ContextListener::ACCEPT_PERMANENTLY; - Close (true); + Close(true); } void -CertDlg::OnTemp (wxCommandEvent & event) +CertDlg::OnTemp(wxCommandEvent & event) { m->answer = svn::ContextListener::ACCEPT_TEMPORARILY; - Close (true); + Close(true); } svn::ContextListener::SslServerTrustAnswer -CertDlg::Answer () const +CertDlg::Answer() const { return m->answer; } wxUint32 -CertDlg::AcceptedFailures () const +CertDlg::AcceptedFailures() const { return m->acceptedFailures; } diff --git a/src/cert_dlg.hpp b/src/cert_dlg.hpp index 7a79ed90..97e204db 100644 --- a/src/cert_dlg.hpp +++ b/src/cert_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,26 +39,26 @@ namespace svn class CertDlg : public wxDialog { public: - CertDlg (wxWindow * parent, - const svn::ContextListener::SslServerTrustData & data); + CertDlg(wxWindow * parent, + const svn::ContextListener::SslServerTrustData & data); - virtual ~CertDlg (); + virtual ~CertDlg(); svn::ContextListener::SslServerTrustAnswer - Answer () const; + Answer() const; wxUint32 - AcceptedFailures () const; + AcceptedFailures() const; private: struct Data; Data * m; private: - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() - void OnPerm (wxCommandEvent & event); - void OnTemp (wxCommandEvent & event); + void OnPerm(wxCommandEvent & event); + void OnTemp(wxCommandEvent & event); }; #endif diff --git a/src/checkout_action.cpp b/src/checkout_action.cpp index 16460cb2..9e0edb9c 100644 --- a/src/checkout_action.cpp +++ b/src/checkout_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,63 +36,63 @@ #include "ids.hpp" #include "utils.hpp" -CheckoutAction::CheckoutAction (wxWindow * parent) - : Action (parent, _("Checkout"), 0) +CheckoutAction::CheckoutAction(wxWindow * parent) + : Action(parent, _("Checkout"), 0) { } bool -CheckoutAction::Prepare () +CheckoutAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - const std::vector & v = GetTargets (); + const std::vector & v = GetTargets(); - svn::Path selectedUrl (""); + svn::Path selectedUrl(""); - if (v.size () == 1) + if (v.size() == 1) { - svn::Path selectedPath (v [0]); + svn::Path selectedPath(v [0]); - if (selectedPath.isUrl ()) + if (selectedPath.isUrl()) { selectedUrl = selectedPath; } } - CheckoutDlg dlg (GetParent (), selectedUrl); + CheckoutDlg dlg(GetParent(), selectedUrl); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - m_data = dlg.GetData (); + m_data = dlg.GetData(); return true; } bool -CheckoutAction::Perform () +CheckoutAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); TrimString(m_data.DestFolder); - wxString dest_folder (m_data.DestFolder); + wxString dest_folder(m_data.DestFolder); UnixPath(dest_folder); TrimString(m_data.RepUrl); long revnum = -1; - svn::Revision revision (svn::Revision::HEAD); + svn::Revision revision(svn::Revision::HEAD); svn::Revision pegRevision; // Did the user request a specific revision?: if (!m_data.UseLatest) { TrimString(m_data.Revision); - if (!m_data.Revision.IsEmpty ()) + if (!m_data.Revision.IsEmpty()) { m_data.Revision.ToLong(&revnum, 10); // If this fails, revnum is unchanged. } @@ -104,39 +104,39 @@ CheckoutAction::Perform () if (!m_data.NotSpecified) { TrimString(m_data.PegRevision); - if (!m_data.PegRevision.IsEmpty ()) + if (!m_data.PegRevision.IsEmpty()) { m_data.PegRevision.ToLong(&revnum, 10); // If this fails, revnum is unchanged. } if (revnum != -1) pegRevision = svn::Revision(revnum); } - - wxSetWorkingDirectory (m_data.DestFolder); - svn::Path repUrlUtf8 (PathUtf8 (m_data.RepUrl)); - svn::Path destFolderUtf8 (PathUtf8 (dest_folder)); + wxSetWorkingDirectory(m_data.DestFolder); + + svn::Path repUrlUtf8(PathUtf8(m_data.RepUrl)); + svn::Path destFolderUtf8(PathUtf8(dest_folder)); bool ignoreExternals = m_data.IgnoreExternals; - client.checkout (repUrlUtf8.c_str (), - destFolderUtf8, - revision, - m_data.Recursive, - ignoreExternals, - pegRevision); + client.checkout(repUrlUtf8.c_str(), + destFolderUtf8, + revision, + m_data.Recursive, + ignoreExternals, + pegRevision); // now post event to add bookmark to bookmarks if (m_data.Bookmarks) { - ActionEvent::Post (GetParent (), TOKEN_ADD_BOOKMARK, m_data.DestFolder); + ActionEvent::Post(GetParent(), TOKEN_ADD_BOOKMARK, m_data.DestFolder); } - + return true; } bool -CheckoutAction::CheckStatusSel (const svn::StatusSel & statusSel) +CheckoutAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/checkout_action.hpp b/src/checkout_action.hpp index 844dc890..98189cf3 100644 --- a/src/checkout_action.hpp +++ b/src/checkout_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -42,16 +42,16 @@ class CheckoutAction : public Action * * @param parent parent window */ - CheckoutAction (wxWindow * parent); + CheckoutAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: CheckoutData m_data; diff --git a/src/checkout_data.hpp b/src/checkout_data.hpp index 15fdb017..32380306 100644 --- a/src/checkout_data.hpp +++ b/src/checkout_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -29,7 +29,7 @@ struct CheckoutData { - CheckoutData () + CheckoutData() { UseLatest = true; NotSpecified = true; diff --git a/src/checkout_dlg.cpp b/src/checkout_dlg.cpp index d41f6ab5..5d864bcb 100644 --- a/src/checkout_dlg.cpp +++ b/src/checkout_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -58,205 +58,205 @@ struct CheckoutDlg::Data public: CheckoutData data; - Data (wxWindow * wnd) + Data(wxWindow * wnd) { // create controls wxStaticBox * urlBox = - new wxStaticBox (wnd, 0, _("URL")); - HistoryValidator valModule (HISTORY_REPOSITORY, &data.RepUrl); + new wxStaticBox(wnd, 0, _("URL")); + HistoryValidator valModule(HISTORY_REPOSITORY, &data.RepUrl); m_comboRepUrl = - new wxComboBox (wnd, -1, wxEmptyString, wxDefaultPosition, - wxSize (235, -1), 0, 0, wxCB_DROPDOWN, valModule); - m_comboRepUrl->SetHelpText (_("Enter the repository URL (not local path) here.")); + new wxComboBox(wnd, -1, wxEmptyString, wxDefaultPosition, + wxSize(235, -1), 0, 0, wxCB_DROPDOWN, valModule); + m_comboRepUrl->SetHelpText(_("Enter the repository URL (not local path) here.")); wxStaticBox * destBox = - new wxStaticBox (wnd, 0, _("Destination Directory")); - HistoryValidator valWorkingDir (HISTORY_WORKING_DIRECTORY, &data.DestFolder); + new wxStaticBox(wnd, 0, _("Destination Directory")); + HistoryValidator valWorkingDir(HISTORY_WORKING_DIRECTORY, &data.DestFolder); m_comboDest = - new wxComboBox (wnd, -1, wxEmptyString, wxDefaultPosition, - wxSize(205, -1), 0, 0, wxCB_DROPDOWN, valWorkingDir); - m_comboDest->SetHelpText (_("Enter the local path where you want the code checked out to here.")); + new wxComboBox(wnd, -1, wxEmptyString, wxDefaultPosition, + wxSize(205, -1), 0, 0, wxCB_DROPDOWN, valWorkingDir); + m_comboDest->SetHelpText(_("Enter the local path where you want the code checked out to here.")); wxButton * browse = - new wxButton (wnd, ID_BUTTON_BROWSE, wxT("..."), - wxDefaultPosition, wxSize(20, -1) ); + new wxButton(wnd, ID_BUTTON_BROWSE, wxT("..."), + wxDefaultPosition, wxSize(20, -1)); wxStaticBox * revisionBox = - new wxStaticBox (wnd, -1, _("Revision")); - wxTextValidator valRevision (wxFILTER_NUMERIC, &data.Revision); + new wxStaticBox(wnd, -1, _("Revision")); + wxTextValidator valRevision(wxFILTER_NUMERIC, &data.Revision); m_textRevision = - new wxTextCtrl (wnd, -1, wxEmptyString, wxDefaultPosition, - wxSize(50, -1), 0, valRevision); - m_textRevision->SetHelpText (_("If not using the latest version of the files, specify which revision to use here.")); + new wxTextCtrl(wnd, -1, wxEmptyString, wxDefaultPosition, + wxSize(50, -1), 0, valRevision); + m_textRevision->SetHelpText(_("If not using the latest version of the files, specify which revision to use here.")); - wxGenericValidator valLatest (&data.UseLatest); + wxGenericValidator valLatest(&data.UseLatest); m_checkUseLatest = - new wxCheckBox (wnd, ID_USELATEST, _("Use latest"), + new wxCheckBox(wnd, ID_USELATEST, _("Use latest"), wxDefaultPosition, wxDefaultSize, 0, valLatest); - m_checkUseLatest->SetHelpText (_("Set this to get the latest version of the files in the repository.")); + m_checkUseLatest->SetHelpText(_("Set this to get the latest version of the files in the repository.")); wxStaticBox * pegRevisionBox = - new wxStaticBox (wnd, -1, _("Peg Revision")); - wxTextValidator valPegRevision (wxFILTER_NUMERIC, &data.PegRevision); + new wxStaticBox(wnd, -1, _("Peg Revision")); + wxTextValidator valPegRevision(wxFILTER_NUMERIC, &data.PegRevision); m_textPegRevision = - new wxTextCtrl (wnd, -1, wxEmptyString, wxDefaultPosition, - wxSize(50, -1), 0, valPegRevision); - m_textPegRevision->SetHelpText (_("If the files were renamed or moved some time, specify which peg revision to use here.")); + new wxTextCtrl(wnd, -1, wxEmptyString, wxDefaultPosition, + wxSize(50, -1), 0, valPegRevision); + m_textPegRevision->SetHelpText(_("If the files were renamed or moved some time, specify which peg revision to use here.")); - wxGenericValidator valNotSpecified (&data.NotSpecified); + wxGenericValidator valNotSpecified(&data.NotSpecified); m_checkNotSpecified = - new wxCheckBox (wnd, ID_NOTSPECIFIED, _("Not specified"), - wxDefaultPosition, wxDefaultSize, 0, valNotSpecified); - m_checkNotSpecified->SetHelpText (_("Set this to use BASE/HEAD (current) peg revision of the files.")); + new wxCheckBox(wnd, ID_NOTSPECIFIED, _("Not specified"), + wxDefaultPosition, wxDefaultSize, 0, valNotSpecified); + m_checkNotSpecified->SetHelpText(_("Set this to use BASE/HEAD (current) peg revision of the files.")); wxCheckBox * recursive = - new wxCheckBox (wnd, -1, _("Recursive"), - wxDefaultPosition, wxDefaultSize, 0, - wxGenericValidator(&data.Recursive)); - recursive->SetHelpText (_("Set to get all subdirectories from the URL also.")); + new wxCheckBox(wnd, -1, _("Recursive"), + wxDefaultPosition, wxDefaultSize, 0, + wxGenericValidator(&data.Recursive)); + recursive->SetHelpText(_("Set to get all subdirectories from the URL also.")); wxCheckBox * bookmarks = - new wxCheckBox (wnd, -1, _("Add to bookmarks"), - wxDefaultPosition, wxDefaultSize, 0, - wxGenericValidator(&data.Bookmarks)); - bookmarks->SetHelpText (_("Set to automatically create a new working copy bookmark.")); + new wxCheckBox(wnd, -1, _("Add to bookmarks"), + wxDefaultPosition, wxDefaultSize, 0, + wxGenericValidator(&data.Bookmarks)); + bookmarks->SetHelpText(_("Set to automatically create a new working copy bookmark.")); wxCheckBox * ignoreExternals = - new wxCheckBox (wnd, -1, _("Ignore externals"), - wxDefaultPosition, wxDefaultSize, 0, - wxGenericValidator(&data.IgnoreExternals)); - ignoreExternals->SetHelpText (_("Set to ignore external definitions and the external working copies managed by them.")); - m_buttonOk = new wxButton (wnd, wxID_OK, _("OK" )); - wxButton * cancel = new wxButton( wnd, wxID_CANCEL, _("Cancel")); + new wxCheckBox(wnd, -1, _("Ignore externals"), + wxDefaultPosition, wxDefaultSize, 0, + wxGenericValidator(&data.IgnoreExternals)); + ignoreExternals->SetHelpText(_("Set to ignore external definitions and the external working copies managed by them.")); + m_buttonOk = new wxButton(wnd, wxID_OK, _("OK")); + wxButton * cancel = new wxButton(wnd, wxID_CANCEL, _("Cancel")); // TODO: online help. Help button doesn't work yet, so commented out. // wxButton* help = new wxButton( wnd, wxID_HELP, _("Help")); // place controls // URL row wxStaticBoxSizer * urlSizer = - new wxStaticBoxSizer (urlBox, wxHORIZONTAL); - urlSizer->Add (m_comboRepUrl, 1, wxALL | wxEXPAND, 5); + new wxStaticBoxSizer(urlBox, wxHORIZONTAL); + urlSizer->Add(m_comboRepUrl, 1, wxALL | wxEXPAND, 5); // Destination row wxStaticBoxSizer * destSizer = - new wxStaticBoxSizer (destBox, wxHORIZONTAL); - destSizer->Add (m_comboDest, 1, wxALL | wxEXPAND, 5); - destSizer->Add (browse, 0, wxALL, 5); + new wxStaticBoxSizer(destBox, wxHORIZONTAL); + destSizer->Add(m_comboDest, 1, wxALL | wxEXPAND, 5); + destSizer->Add(browse, 0, wxALL, 5); // Revision row - wxBoxSizer * reSizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer * reSizer = new wxBoxSizer(wxHORIZONTAL); wxStaticBoxSizer * revisionSizer = - new wxStaticBoxSizer (revisionBox, wxHORIZONTAL); - revisionSizer->Add (m_textRevision, 1, wxALL | wxEXPAND, 5); - revisionSizer->Add (m_checkUseLatest, 0, - wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); - reSizer->Add (revisionSizer, 1, wxALL | wxEXPAND, 0); + new wxStaticBoxSizer(revisionBox, wxHORIZONTAL); + revisionSizer->Add(m_textRevision, 1, wxALL | wxEXPAND, 5); + revisionSizer->Add(m_checkUseLatest, 0, + wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); + reSizer->Add(revisionSizer, 1, wxALL | wxEXPAND, 0); - wxBoxSizer * preSizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer * preSizer = new wxBoxSizer(wxHORIZONTAL); // Peg revision row wxStaticBoxSizer * pegRevisionSizer = - new wxStaticBoxSizer (pegRevisionBox, wxHORIZONTAL); - pegRevisionSizer->Add (m_textPegRevision, 1, wxALL | wxEXPAND, 5); - pegRevisionSizer->Add (m_checkNotSpecified, 0, - wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); - preSizer->Add (pegRevisionSizer, 1, wxALL | wxEXPAND, 0); + new wxStaticBoxSizer(pegRevisionBox, wxHORIZONTAL); + pegRevisionSizer->Add(m_textPegRevision, 1, wxALL | wxEXPAND, 5); + pegRevisionSizer->Add(m_checkNotSpecified, 0, + wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); + preSizer->Add(pegRevisionSizer, 1, wxALL | wxEXPAND, 0); // Button row - wxBoxSizer * buttonSizer = new wxBoxSizer (wxHORIZONTAL); - buttonSizer->Add (m_buttonOk, 0, wxALL, 10); - buttonSizer->Add (cancel, 0, wxALL, 10); + wxBoxSizer * buttonSizer = new wxBoxSizer(wxHORIZONTAL); + buttonSizer->Add(m_buttonOk, 0, wxALL, 10); + buttonSizer->Add(cancel, 0, wxALL, 10); // Online Help to be done later // buttonSizer->Add(help, 0, wxALL, 10); // Add explicit context-sensitive help button for non-MSW #ifndef __WXMSW__ - buttonSizer->Add (new wxContextHelpButton(wnd), 0, wxALL, 10); + buttonSizer->Add(new wxContextHelpButton(wnd), 0, wxALL, 10); #endif // Extras sizer - wxBoxSizer * extrasSizer = new wxBoxSizer (wxHORIZONTAL); - extrasSizer->Add (bookmarks, 0, wxALL | wxCENTER, 5); - extrasSizer->Add (recursive, 0, wxALL | wxCENTER, 5); - extrasSizer->Add (ignoreExternals, 0, wxALL | wxCENTER, 5); + wxBoxSizer * extrasSizer = new wxBoxSizer(wxHORIZONTAL); + extrasSizer->Add(bookmarks, 0, wxALL | wxCENTER, 5); + extrasSizer->Add(recursive, 0, wxALL | wxCENTER, 5); + extrasSizer->Add(ignoreExternals, 0, wxALL | wxCENTER, 5); // Add all sizers to main sizer - wxBoxSizer * mainSizer = new wxBoxSizer (wxVERTICAL); - mainSizer->Add (urlSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (destSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (reSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (preSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (extrasSizer, 0, wxALL | wxCENTER, 5); - mainSizer->Add (buttonSizer, 0, wxALL | wxCENTER, 5); + wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(urlSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(destSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(reSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(preSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(extrasSizer, 0, wxALL | wxCENTER, 5); + mainSizer->Add(buttonSizer, 0, wxALL | wxCENTER, 5); - wnd->SetAutoLayout (true); - wnd->SetSizer (mainSizer); + wnd->SetAutoLayout(true); + wnd->SetSizer(mainSizer); - mainSizer->SetSizeHints (wnd); - mainSizer->Fit (wnd); + mainSizer->SetSizeHints(wnd); + mainSizer->Fit(wnd); - m_buttonOk->SetDefault (); + m_buttonOk->SetDefault(); } void CheckControls() { - bool useLatest = m_checkUseLatest->IsChecked (); - bool notSpecified = m_checkNotSpecified->IsChecked (); + bool useLatest = m_checkUseLatest->IsChecked(); + bool notSpecified = m_checkNotSpecified->IsChecked(); - m_textRevision->Enable (!useLatest); - m_textPegRevision->Enable (!notSpecified); + m_textRevision->Enable(!useLatest); + m_textPegRevision->Enable(!notSpecified); bool ok = true; if (!useLatest) { - ok = CheckRevision (m_textRevision->GetValue ()); + ok = CheckRevision(m_textRevision->GetValue()); } if (!notSpecified) { - ok = CheckRevision (m_textPegRevision->GetValue ()); + ok = CheckRevision(m_textPegRevision->GetValue()); } - if (m_comboDest->GetValue ().Length () <= 0) + if (m_comboDest->GetValue().Length() <= 0) { ok = false; } - if (m_comboRepUrl->GetValue ().Length () <= 0) + if (m_comboRepUrl->GetValue().Length() <= 0) { ok = false; } - m_buttonOk->Enable (ok); + m_buttonOk->Enable(ok); if (ok) { - m_buttonOk->SetDefault (); + m_buttonOk->SetDefault(); } } }; -BEGIN_EVENT_TABLE (CheckoutDlg, wxDialog) - EVT_BUTTON (ID_BUTTON_BROWSE, CheckoutDlg::OnBrowse) - EVT_CHECKBOX (ID_USELATEST, CheckoutDlg::OnUseLatest) - EVT_TEXT (-1, CheckoutDlg::OnText) -// EVT_BUTTON (wxID_HELP, CheckoutDlg::OnHelp) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(CheckoutDlg, wxDialog) + EVT_BUTTON(ID_BUTTON_BROWSE, CheckoutDlg::OnBrowse) + EVT_CHECKBOX(ID_USELATEST, CheckoutDlg::OnUseLatest) + EVT_TEXT(-1, CheckoutDlg::OnText) + // EVT_BUTTON (wxID_HELP, CheckoutDlg::OnHelp) +END_EVENT_TABLE() -CheckoutDlg::CheckoutDlg (wxWindow * parent, - const svn::Path & selectedUrl) +CheckoutDlg::CheckoutDlg(wxWindow * parent, + const svn::Path & selectedUrl) { - // Add the context-sensitive help button on the caption for MSW + // Add the context-sensitive help button on the caption for MSW #ifdef __WXMSW__ - SetExtraStyle (wxDIALOG_EX_CONTEXTHELP); + SetExtraStyle(wxDIALOG_EX_CONTEXTHELP); #endif - Create (parent, -1, _("Checkout"), wxDefaultPosition, - wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); + Create(parent, -1, _("Checkout"), wxDefaultPosition, + wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); - m = new Data (this); + m = new Data(this); CentreOnParent(); - m->data.RepUrl = Utf8ToLocal (selectedUrl.c_str ()); + m->data.RepUrl = Utf8ToLocal(selectedUrl.c_str()); } -CheckoutDlg::~CheckoutDlg () +CheckoutDlg::~CheckoutDlg() { delete m; } @@ -265,50 +265,50 @@ CheckoutDlg::~CheckoutDlg () * Brings up a directory dialog defaulted to the user's home directory. */ void -CheckoutDlg::OnBrowse (wxCommandEvent & event) +CheckoutDlg::OnBrowse(wxCommandEvent & event) { // Transfer data from controls into m_pData: - TransferDataFromWindow (); - wxDirDialog dialog (this, - _("Select a destination directory"), - wxGetHomeDir (), wxDD_NEW_DIR_BUTTON); + TransferDataFromWindow(); + wxDirDialog dialog(this, + _("Select a destination directory"), + wxGetHomeDir(), wxDD_NEW_DIR_BUTTON); - if (dialog.ShowModal () == wxID_OK) + if (dialog.ShowModal() == wxID_OK) { - m->data.DestFolder = dialog.GetPath (); + m->data.DestFolder = dialog.GetPath(); // Transfer data from m_pData back into controls: TransferDataToWindow(); - m->CheckControls (); + m->CheckControls(); } } void -CheckoutDlg::InitDialog () +CheckoutDlg::InitDialog() { wxDialog::InitDialog(); m->CheckControls(); } void -CheckoutDlg::OnUseLatest (wxCommandEvent &) +CheckoutDlg::OnUseLatest(wxCommandEvent &) { m->CheckControls(); } const CheckoutData & -CheckoutDlg::GetData () const +CheckoutDlg::GetData() const { return m->data; } void -CheckoutDlg::OnText (wxCommandEvent &) +CheckoutDlg::OnText(wxCommandEvent &) { - m->CheckControls (); + m->CheckControls(); } void -CheckoutDlg::OnHelp (wxCommandEvent &) +CheckoutDlg::OnHelp(wxCommandEvent &) { // @todo Has to be re-integrated for Online Help // ::wxGetApp ().GetHelpController().Display(wxT("Checkout dialog")); diff --git a/src/checkout_dlg.hpp b/src/checkout_dlg.hpp index cd5c4e23..c3864b38 100644 --- a/src/checkout_dlg.hpp +++ b/src/checkout_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -46,18 +46,18 @@ class CheckoutDlg : public wxDialog * @param selectedUrl pre-fills the URL field with * this URL */ - CheckoutDlg (wxWindow * parent, const svn::Path & selectedUrl); + CheckoutDlg(wxWindow * parent, const svn::Path & selectedUrl); /** * destructor */ - virtual ~CheckoutDlg (); + virtual ~CheckoutDlg(); /** * returns the checkout data */ const CheckoutData & - GetData () const; + GetData() const; private: /** hide implementation details */ @@ -65,21 +65,21 @@ class CheckoutDlg : public wxDialog Data * m; void - OnBrowse (wxCommandEvent & event); + OnBrowse(wxCommandEvent & event); void - OnText (wxCommandEvent & event); + OnText(wxCommandEvent & event); void - OnHelp (wxCommandEvent & event); + OnHelp(wxCommandEvent & event); void - OnUseLatest (wxCommandEvent & event); + OnUseLatest(wxCommandEvent & event); void - InitDialog (); + InitDialog(); - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/cleanup_action.cpp b/src/cleanup_action.cpp index 83d1e1db..36f47961 100644 --- a/src/cleanup_action.cpp +++ b/src/cleanup_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,39 +35,39 @@ #include "tracer.hpp" #include "utils.hpp" -CleanupAction::CleanupAction (wxWindow * parent) - : Action (parent, _("Cleanup"), 0) +CleanupAction::CleanupAction(wxWindow * parent) + : Action(parent, _("Cleanup"), 0) { } bool -CleanupAction::Prepare () +CleanupAction::Prepare() { - return Action::Prepare (); + return Action::Prepare(); } bool -CleanupAction::Perform () +CleanupAction::Perform() { - svn::Client client (GetContext ()); - const svn::Path & path = GetPath (); + svn::Client client(GetContext()); + const svn::Path & path = GetPath(); - wxSetWorkingDirectory (Utf8ToLocal (path.c_str ())); - client.cleanup (path.c_str ()); + wxSetWorkingDirectory(Utf8ToLocal(path.c_str())); + client.cleanup(path.c_str()); return true; } bool -CleanupAction::CheckStatusSel (const svn::StatusSel & statusSel) +CleanupAction::CheckStatusSel(const svn::StatusSel & statusSel) { - if (statusSel.size () != 1) + if (statusSel.size() != 1) return false; - if (statusSel.hasUnversioned ()) + if (statusSel.hasUnversioned()) return false; - if (statusSel.hasUrl ()) + if (statusSel.hasUrl()) return false; return true; diff --git a/src/cleanup_action.hpp b/src/cleanup_action.hpp index 75f7139b..0bd78dfb 100644 --- a/src/cleanup_action.hpp +++ b/src/cleanup_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,21 +39,21 @@ namespace svn class CleanupAction : public Action { public: - CleanupAction (wxWindow * parent); + CleanupAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: // hide default and copy constructor - CleanupAction (); - CleanupAction (const CleanupAction &); + CleanupAction(); + CleanupAction(const CleanupAction &); }; #endif diff --git a/src/columns.cpp b/src/columns.cpp index f736f3af..689c0ebf 100644 --- a/src/columns.cpp +++ b/src/columns.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -32,7 +32,7 @@ const int Columns::SORT_COLUMN_OFFSET = ID_ColumnSort_Max - ID_Column_Max; -Columns::Columns () +Columns::Columns() { /** * ATTENTION! @@ -42,28 +42,28 @@ Columns::Columns () * the order of column in src/columns.cpp. * This order should be the same in all 3 cases. */ - COLUMNS[0] = Column (wxT("Name"), _("Name"), ID_Column_Name); // cannot show/hide name - COLUMNS[1] = Column (wxT("Path"), _("Path"), ID_Column_Path); // cannot show/hide path - COLUMNS[2] = Column (wxT("Revision"), _("Revision"), ID_Column_Rev); - COLUMNS[3] = Column (wxT("RepRev"), _("Rep. Rev."), ID_Column_Cmt_Rev); - COLUMNS[4] = Column (wxT("Author"), _("Author"), ID_Column_Author); - COLUMNS[5] = Column (wxT("Status"), _("Status"), ID_Column_Text_Status); - COLUMNS[6] = Column (wxT("PropStatus"), _("Prop Status"), ID_Column_Prop_Status); - COLUMNS[7] = Column (wxT("LastChanged"), _("Last Changed"), ID_Column_Cmt_Date); - COLUMNS[8] = Column (wxT("Extension"), _("Extension"), ID_Column_Extension); - COLUMNS[9] = Column (wxT("Date"), _("Date"), ID_Column_Text_Time); - COLUMNS[10] = Column (wxT("PropDate"), _("Prop Date"), ID_Column_Prop_Time); - COLUMNS[11] = Column (wxT("LockOwner"), _("Lock Owner"), ID_Column_LockOwner); - COLUMNS[12] = Column (wxT("LockComment"), _("Lock Comment"), ID_Column_LockComment); - COLUMNS[13] = Column (wxT("Checksum"), _("Checksum"), ID_Column_Checksum); - COLUMNS[14] = Column (wxT("URL"), _("URL"), ID_Column_Url); - COLUMNS[15] = Column (wxT("Repository"), _("Repository"), ID_Column_Repos); - COLUMNS[16] = Column (wxT("UUID"), _("UUID"), ID_Column_Uuid); - COLUMNS[17] = Column (wxT("Schedule"), _("Schedule"), ID_Column_Schedule); - COLUMNS[18] = Column (wxT("Copied"), _("Copied"), ID_Column_Copied); - COLUMNS[19] = Column (wxT("ConflictOld"), _("Conflict BASE"), ID_Column_ConflictOld); - COLUMNS[20] = Column (wxT("ConflictNew"), _("Conflict HEAD"), ID_Column_ConflictNew); - COLUMNS[21] = Column (wxT("ConflictWork"), _("Conflict Work"), ID_Column_ConflictWrk); + COLUMNS[0] = Column(wxT("Name"), _("Name"), ID_Column_Name); // cannot show/hide name + COLUMNS[1] = Column(wxT("Path"), _("Path"), ID_Column_Path); // cannot show/hide path + COLUMNS[2] = Column(wxT("Revision"), _("Revision"), ID_Column_Rev); + COLUMNS[3] = Column(wxT("RepRev"), _("Rep. Rev."), ID_Column_Cmt_Rev); + COLUMNS[4] = Column(wxT("Author"), _("Author"), ID_Column_Author); + COLUMNS[5] = Column(wxT("Status"), _("Status"), ID_Column_Text_Status); + COLUMNS[6] = Column(wxT("PropStatus"), _("Prop Status"), ID_Column_Prop_Status); + COLUMNS[7] = Column(wxT("LastChanged"), _("Last Changed"), ID_Column_Cmt_Date); + COLUMNS[8] = Column(wxT("Extension"), _("Extension"), ID_Column_Extension); + COLUMNS[9] = Column(wxT("Date"), _("Date"), ID_Column_Text_Time); + COLUMNS[10] = Column(wxT("PropDate"), _("Prop Date"), ID_Column_Prop_Time); + COLUMNS[11] = Column(wxT("LockOwner"), _("Lock Owner"), ID_Column_LockOwner); + COLUMNS[12] = Column(wxT("LockComment"), _("Lock Comment"), ID_Column_LockComment); + COLUMNS[13] = Column(wxT("Checksum"), _("Checksum"), ID_Column_Checksum); + COLUMNS[14] = Column(wxT("URL"), _("URL"), ID_Column_Url); + COLUMNS[15] = Column(wxT("Repository"), _("Repository"), ID_Column_Repos); + COLUMNS[16] = Column(wxT("UUID"), _("UUID"), ID_Column_Uuid); + COLUMNS[17] = Column(wxT("Schedule"), _("Schedule"), ID_Column_Schedule); + COLUMNS[18] = Column(wxT("Copied"), _("Copied"), ID_Column_Copied); + COLUMNS[19] = Column(wxT("ConflictOld"), _("Conflict BASE"), ID_Column_ConflictOld); + COLUMNS[20] = Column(wxT("ConflictNew"), _("Conflict HEAD"), ID_Column_ConflictNew); + COLUMNS[21] = Column(wxT("ConflictWork"), _("Conflict Work"), ID_Column_ConflictWrk); } Column diff --git a/src/columns.hpp b/src/columns.hpp index 9ed13a28..5de67137 100644 --- a/src/columns.hpp +++ b/src/columns.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -30,17 +30,17 @@ struct Column { - const wxChar * name; + const wxChar * name; const wxChar * caption; int id; - Column () - : name (wxT("")), caption (wxT("")), id (0) + Column() + : name(wxT("")), caption(wxT("")), id(0) { } - Column (const wxChar * name_, const wxChar * caption_, int id_) - : name (name_), caption (caption_), id (id_) + Column(const wxChar * name_, const wxChar * caption_, int id_) + : name(name_), caption(caption_), id(id_) { } }; @@ -51,7 +51,7 @@ struct Columns Column COLUMNS[ID_ColumnSort_Min - ID_Column_Min]; - Columns (); + Columns(); Column operator [](int index); diff --git a/src/commit_action.cpp b/src/commit_action.cpp index f6d1119e..2fbceadb 100644 --- a/src/commit_action.cpp +++ b/src/commit_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,69 +36,69 @@ #include "ids.hpp" #include "utils.hpp" -CommitAction::CommitAction (wxWindow * parent) - : Action (parent, _("Commit"), 0) +CommitAction::CommitAction(wxWindow * parent) + : Action(parent, _("Commit"), 0) { } bool -CommitAction::Prepare () +CommitAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - CommitDlg dlg(GetParent ()); + CommitDlg dlg(GetParent()); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - m_recursive = dlg.GetRecursive (); - m_message = dlg.GetMessage (); - m_keepLocks = dlg.GetKeepLocks (); + m_recursive = dlg.GetRecursive(); + m_message = dlg.GetMessage(); + m_keepLocks = dlg.GetKeepLocks(); return true; } bool -CommitAction::Perform () +CommitAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); - const svn::StatusSel & statusSel = GetStatusSel (); + const svn::StatusSel & statusSel = GetStatusSel(); - std::string messageUtf8 (LocalToUtf8 (m_message)); + std::string messageUtf8(LocalToUtf8(m_message)); svn::Pool pool; - svn_revnum_t revision = - client.commit (statusSel.targets (), messageUtf8.c_str (), - m_recursive, m_keepLocks); + svn_revnum_t revision = + client.commit(statusSel.targets(), messageUtf8.c_str(), + m_recursive, m_keepLocks); wxString str; - str = wxString::Format (wxT("%s %") - wxT(SVN_REVNUM_T_FMT) - wxT("."), - _("Committed revision"), revision); - Trace (str); + str = wxString::Format(wxT("%s %") + wxT(SVN_REVNUM_T_FMT) + wxT("."), + _("Committed revision"), revision); + Trace(str); return true; } bool -CommitAction::CheckStatusSel (const svn::StatusSel & statusSel) +CommitAction::CheckStatusSel(const svn::StatusSel & statusSel) { - if (0 == statusSel.size ()) + if (0 == statusSel.size()) return false; - if (statusSel.hasUnversioned ()) + if (statusSel.hasUnversioned()) return false; - if (statusSel.hasUrl ()) + if (statusSel.hasUrl()) return false; return true; diff --git a/src/commit_action.hpp b/src/commit_action.hpp index c0e33259..3b13255f 100644 --- a/src/commit_action.hpp +++ b/src/commit_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,16 +36,16 @@ namespace svn class CommitAction : public Action { public: - CommitAction (wxWindow * parent); + CommitAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: bool m_recursive; @@ -53,8 +53,8 @@ class CommitAction : public Action wxString m_message; // hide default and copy constructor - CommitAction (); - CommitAction (const CommitAction &); + CommitAction(); + CommitAction(const CommitAction &); }; #endif diff --git a/src/commit_dlg.cpp b/src/commit_dlg.cpp index 27860c0f..ccc949c3 100644 --- a/src/commit_dlg.cpp +++ b/src/commit_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -44,8 +44,8 @@ struct CommitDlg::Data wxString message; - Data (wxWindow * window, bool unexpectedCommit) - : recursive (true), comboHistory (0), msg (0) + Data(wxWindow * window, bool unexpectedCommit) + : recursive(true), comboHistory(0), msg(0) { // create controls wxStaticBox* msgBox = @@ -56,142 +56,142 @@ struct CommitDlg::Data else keepLocks = false; - wxSize msgSize (window->GetCharWidth () * 80, - window->GetCharHeight () * 10); + wxSize msgSize(window->GetCharWidth() * 80, + window->GetCharHeight() * 10); { Preferences prefs; - HistoryValidator val (HISTORY_COMMIT_LOG, &message, false, - prefs.useLastCommitMessage); - msg = new wxTextCtrl (window, -1, wxEmptyString, wxDefaultPosition, - msgSize, wxTE_MULTILINE, val); + HistoryValidator val(HISTORY_COMMIT_LOG, &message, false, + prefs.useLastCommitMessage); + msg = new wxTextCtrl(window, -1, wxEmptyString, wxDefaultPosition, + msgSize, wxTE_MULTILINE, val); } - wxStaticText * labelHistory = new wxStaticText ( + wxStaticText * labelHistory = new wxStaticText( window, -1, _("Recent entries:"), wxDefaultPosition); { - HistoryValidator val (HISTORY_COMMIT_LOG, 0, true); - comboHistory = new wxComboBox ( - window, ID_HISTORY_COMBO_BOX, wxEmptyString, - wxDefaultPosition, wxDefaultSize, 0, NULL, + HistoryValidator val(HISTORY_COMMIT_LOG, 0, true); + comboHistory = new wxComboBox( + window, ID_HISTORY_COMBO_BOX, wxEmptyString, + wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY, val); } wxCheckBox * checkRecursive = NULL; if (!unexpectedCommit) { - wxGenericValidator val (&recursive); + wxGenericValidator val(&recursive); checkRecursive = - new wxCheckBox (window, -1, _("Recursive"), - wxDefaultPosition, wxDefaultSize, 0, - val); + new wxCheckBox(window, -1, _("Recursive"), + wxDefaultPosition, wxDefaultSize, 0, + val); } wxCheckBox * checkKeepLocks = NULL; if (!unexpectedCommit) { - wxGenericValidator val (&keepLocks); + wxGenericValidator val(&keepLocks); checkKeepLocks = - new wxCheckBox (window, -1, _("Keep locks"), - wxDefaultPosition, wxDefaultSize, 0, - val); + new wxCheckBox(window, -1, _("Keep locks"), + wxDefaultPosition, wxDefaultSize, 0, + val); } wxButton* ok = - new wxButton (window, wxID_OK, _("OK" )); + new wxButton(window, wxID_OK, _("OK")); wxButton* cancel = - new wxButton (window, wxID_CANCEL, _("Cancel")); + new wxButton(window, wxID_CANCEL, _("Cancel")); // position controls wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); // The message field: wxStaticBoxSizer *msgSizer = - new wxStaticBoxSizer (msgBox, wxHORIZONTAL); - msgSizer->Add (msg, 1, wxALL | wxEXPAND, 5); + new wxStaticBoxSizer(msgBox, wxHORIZONTAL); + msgSizer->Add(msg, 1, wxALL | wxEXPAND, 5); // the history combo - wxBoxSizer * histSizer = new wxBoxSizer (wxHORIZONTAL); - histSizer->Add (labelHistory, 0, wxALL, 5); - histSizer->Add (comboHistory, 1, wxALL | wxEXPAND, 5); + wxBoxSizer * histSizer = new wxBoxSizer(wxHORIZONTAL); + histSizer->Add(labelHistory, 0, wxALL, 5); + histSizer->Add(comboHistory, 1, wxALL | wxEXPAND, 5); // The buttons: - wxBoxSizer *buttonSizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); if (!unexpectedCommit) { - buttonSizer->Add (checkRecursive, 1, - wxALL | wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT, - 10); + buttonSizer->Add(checkRecursive, 1, + wxALL | wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT, + 10); } if (!unexpectedCommit) { - buttonSizer->Add (checkKeepLocks, 1, - wxALL | wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT, - 10); + buttonSizer->Add(checkKeepLocks, 1, + wxALL | wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT, + 10); } - buttonSizer->Add (ok, 0, wxALL, 10); - buttonSizer->Add (cancel, 0, wxALL, 10); + buttonSizer->Add(ok, 0, wxALL, 10); + buttonSizer->Add(cancel, 0, wxALL, 10); - wxBoxSizer *topSizer = new wxBoxSizer (wxHORIZONTAL); - topSizer->Add (msgSizer, 1, wxALL | wxEXPAND, 5); + wxBoxSizer *topSizer = new wxBoxSizer(wxHORIZONTAL); + topSizer->Add(msgSizer, 1, wxALL | wxEXPAND, 5); // Add all the sizers to the main sizer - mainSizer->Add (topSizer, 1, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (histSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (buttonSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(topSizer, 1, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(histSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(buttonSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); - window->SetAutoLayout (true); - window->SetSizer (mainSizer); + window->SetAutoLayout(true); + window->SetSizer(mainSizer); - mainSizer->SetSizeHints (window); - mainSizer->Fit (window); + mainSizer->SetSizeHints(window); + mainSizer->Fit(window); - ok->SetDefault (); + ok->SetDefault(); } }; -BEGIN_EVENT_TABLE (CommitDlg, wxDialog) - EVT_COMBOBOX (ID_HISTORY_COMBO_BOX, CommitDlg::OnHistoryComboBox) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(CommitDlg, wxDialog) + EVT_COMBOBOX(ID_HISTORY_COMBO_BOX, CommitDlg::OnHistoryComboBox) +END_EVENT_TABLE() -CommitDlg::CommitDlg (wxWindow* parent, bool unexpectedCommit) - : wxDialog(parent, -1, unexpectedCommit ? _("Commit Log Message") : _("Commit"), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +CommitDlg::CommitDlg(wxWindow* parent, bool unexpectedCommit) + : wxDialog(parent, -1, unexpectedCommit ? _("Commit Log Message") : _("Commit"), + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - m = new Data (this, unexpectedCommit); - CentreOnParent (); + m = new Data(this, unexpectedCommit); + CentreOnParent(); } -CommitDlg::~CommitDlg () +CommitDlg::~CommitDlg() { delete m; } const wxString & -CommitDlg::GetMessage () const +CommitDlg::GetMessage() const { return m->message; } bool -CommitDlg::GetRecursive () const +CommitDlg::GetRecursive() const { return m->recursive; } bool -CommitDlg::GetKeepLocks () const +CommitDlg::GetKeepLocks() const { return m->keepLocks; } void -CommitDlg::OnHistoryComboBox (wxCommandEvent &) +CommitDlg::OnHistoryComboBox(wxCommandEvent &) { // transfer from combobox to text control - m->msg->SetValue (m->comboHistory->GetValue ()); + m->msg->SetValue(m->comboHistory->GetValue()); } /* ----------------------------------------------------------------- diff --git a/src/commit_dlg.hpp b/src/commit_dlg.hpp index ac375867..45bedea4 100644 --- a/src/commit_dlg.hpp +++ b/src/commit_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -41,34 +41,34 @@ class CommitDlg : public wxDialog /** * destructor */ - virtual ~CommitDlg (); + virtual ~CommitDlg(); /** * @return log message */ const wxString & - GetMessage () const; + GetMessage() const; /** * @return recursive setting */ bool - GetRecursive () const; + GetRecursive() const; /** * @return keepLocks setting */ bool - GetKeepLocks () const; + GetKeepLocks() const; private: /** hide implementation details */ struct Data; Data * m; - void OnHistoryComboBox (wxCommandEvent &); + void OnHistoryComboBox(wxCommandEvent &); private: - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/config.hpp b/src/config.hpp index 3f7be4d6..6c479eeb 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/src/delete_action.cpp b/src/delete_action.cpp index d155ee08..2509fadc 100644 --- a/src/delete_action.cpp +++ b/src/delete_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,42 +36,42 @@ #include "delete_dlg.hpp" #include "utils.hpp" -DeleteAction::DeleteAction (wxWindow * parent) - : Action (parent, _("Delete"), UPDATE_TREE) +DeleteAction::DeleteAction(wxWindow * parent) + : Action(parent, _("Delete"), UPDATE_TREE) { } bool -DeleteAction::Prepare () +DeleteAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - DeleteDlg dlg (GetParent ()); + DeleteDlg dlg(GetParent()); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - m_force = dlg.GetForce (); + m_force = dlg.GetForce(); return true; } bool -DeleteAction::Perform () +DeleteAction::Perform() { - svn::Client client (GetContext ()); - client.remove (GetTargets (), m_force); + svn::Client client(GetContext()); + client.remove(GetTargets(), m_force); return true; } bool -DeleteAction::CheckStatusSel (const svn::StatusSel & statusSel) +DeleteAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/delete_action.hpp b/src/delete_action.hpp index 36fde822..92e06790 100644 --- a/src/delete_action.hpp +++ b/src/delete_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -40,16 +40,16 @@ namespace svn class DeleteAction:public Action { public: - DeleteAction (wxWindow * parent); + DeleteAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: bool m_force; diff --git a/src/delete_dlg.cpp b/src/delete_dlg.cpp index b54978b1..6715613f 100644 --- a/src/delete_dlg.cpp +++ b/src/delete_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,33 +34,33 @@ struct DeleteDlg::Data public: bool force; - Data (wxWindow * window) - : force (false) + Data(wxWindow * window) + : force(false) { wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *topSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); wxStaticText * label = - new wxStaticText (window, -1, _("Do you want to delete the selected files/directories?")); - topSizer->Add (label, 0, wxALL, 5); + new wxStaticText(window, -1, _("Do you want to delete the selected files/directories?")); + topSizer->Add(label, 0, wxALL, 5); // The "force" check box: wxCheckBox* check = new wxCheckBox(window, -1, _("Force removal"), - wxDefaultPosition, wxDefaultSize, 0, - wxGenericValidator(&force)); + wxDefaultPosition, wxDefaultSize, 0, + wxGenericValidator(&force)); // The buttons: - wxButton * ok = new wxButton (window, wxID_OK, _("OK" )); - buttonSizer->Add (ok, 0, wxALL, 10); + wxButton * ok = new wxButton(window, wxID_OK, _("OK")); + buttonSizer->Add(ok, 0, wxALL, 10); - wxButton * cancel = new wxButton (window, wxID_CANCEL, _("Cancel")); - buttonSizer->Add (cancel, 0, wxALL, 10); + wxButton * cancel = new wxButton(window, wxID_CANCEL, _("Cancel")); + buttonSizer->Add(cancel, 0, wxALL, 10); // Add all the sizers to the main sizer - mainSizer->Add (topSizer, 1, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (check, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5); - mainSizer->Add (buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); + mainSizer->Add(topSizer, 1, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(check, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5); + mainSizer->Add(buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); window->SetAutoLayout(true); window->SetSizer(mainSizer); @@ -68,28 +68,28 @@ struct DeleteDlg::Data mainSizer->SetSizeHints(window); mainSizer->Fit(window); - ok->SetDefault (); + ok->SetDefault(); } }; -BEGIN_EVENT_TABLE (DeleteDlg, wxDialog) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(DeleteDlg, wxDialog) +END_EVENT_TABLE() DeleteDlg::DeleteDlg(wxWindow* parent) - : wxDialog(parent, -1, _("Delete"), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + : wxDialog(parent, -1, _("Delete"), + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - m = new Data (this); + m = new Data(this); } -DeleteDlg::~DeleteDlg () +DeleteDlg::~DeleteDlg() { delete m; } bool -DeleteDlg::GetForce () const +DeleteDlg::GetForce() const { return m->force; } diff --git a/src/delete_dlg.hpp b/src/delete_dlg.hpp index 619e6ee3..334e8de3 100644 --- a/src/delete_dlg.hpp +++ b/src/delete_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -32,16 +32,16 @@ class DeleteDlg:public wxDialog public: DeleteDlg(wxWindow* parent); - virtual ~DeleteDlg (); + virtual ~DeleteDlg(); bool - GetForce () const; + GetForce() const; private: struct Data; Data * m; - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/destination_dlg.cpp b/src/destination_dlg.cpp index 3be9ae88..f6c3a861 100644 --- a/src/destination_dlg.cpp +++ b/src/destination_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,10 +36,10 @@ struct DestinationDlg::Data wxString destination; bool force; - Data (wxWindow * window, const wxString & descr, - int flags, const wxString & dest, - const wxString history) - : destination (dest), force (false) + Data(wxWindow * window, const wxString & descr, + int flags, const wxString & dest, + const wxString history) + : destination(dest), force(false) { bool withForce = (flags & WITH_FORCE) != 0; @@ -48,50 +48,50 @@ struct DestinationDlg::Data // The description: wxStaticText * labelDescr = - new wxStaticText (window, -1, descr); - mainSizer->Add (labelDescr, 0, wxALL, 5); + new wxStaticText(window, -1, descr); + mainSizer->Add(labelDescr, 0, wxALL, 5); // The destination: if (wxEmptyString == history) { - wxTextValidator val (wxFILTER_NONE, &destination); + wxTextValidator val(wxFILTER_NONE, &destination); wxTextCtrl * textDest = - new wxTextCtrl (window, -1, wxEmptyString, wxDefaultPosition, - wxSize (200, -1), 0, val); + new wxTextCtrl(window, -1, wxEmptyString, wxDefaultPosition, + wxSize(200, -1), 0, val); - mainSizer->Add (textDest, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(textDest, 0, wxALL | wxEXPAND, 5); } else { - HistoryValidator valDest (history, &destination, false, false); + HistoryValidator valDest(history, &destination, false, false); wxComboBox * comboDest = - new wxComboBox (window, -1, wxEmptyString, wxDefaultPosition, - wxSize (200, -1), 0, 0, wxCB_DROPDOWN, valDest); + new wxComboBox(window, -1, wxEmptyString, wxDefaultPosition, + wxSize(200, -1), 0, 0, wxCB_DROPDOWN, valDest); - mainSizer->Add (comboDest, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(comboDest, 0, wxALL | wxEXPAND, 5); } - + // The force check if (withForce) { - wxGenericValidator val (&force); + wxGenericValidator val(&force); wxCheckBox * check = - new wxCheckBox (window, -1, _("Force"), - wxDefaultPosition, wxDefaultSize, - 0, val); - mainSizer->Add (check, 0, wxALL | wxALIGN_CENTER_HORIZONTAL); + new wxCheckBox(window, -1, _("Force"), + wxDefaultPosition, wxDefaultSize, + 0, val); + mainSizer->Add(check, 0, wxALL | wxALIGN_CENTER_HORIZONTAL); } // The buttons: - wxButton * ok = new wxButton (window, wxID_OK, _("OK" )); - buttonSizer->Add (ok, 0, wxALL, 10); + wxButton * ok = new wxButton(window, wxID_OK, _("OK")); + buttonSizer->Add(ok, 0, wxALL, 10); - wxButton * cancel = new wxButton (window, wxID_CANCEL, _("Cancel")); - buttonSizer->Add (cancel, 0, wxALL, 10); + wxButton * cancel = new wxButton(window, wxID_CANCEL, _("Cancel")); + buttonSizer->Add(cancel, 0, wxALL, 10); // Add all the sizers to the main sizer - mainSizer->Add (buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); + mainSizer->Add(buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); window->SetAutoLayout(true); window->SetSizer(mainSizer); @@ -99,61 +99,61 @@ struct DestinationDlg::Data mainSizer->SetSizeHints(window); mainSizer->Fit(window); - ok->SetDefault (); + ok->SetDefault(); } }; -BEGIN_EVENT_TABLE (DestinationDlg, wxDialog) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(DestinationDlg, wxDialog) +END_EVENT_TABLE() const int DestinationDlg::WITH_FORCE=1; const int DIALOG_FLAGS = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER; -DestinationDlg::DestinationDlg (wxWindow* parent, - const wxString & title, - const wxString & descr, - const int flags, - const wxString & dst, - const wxString & history) - : wxDialog(parent, -1, title, - wxDefaultPosition, wxDefaultSize, - DIALOG_FLAGS) +DestinationDlg::DestinationDlg(wxWindow* parent, + const wxString & title, + const wxString & descr, + const int flags, + const wxString & dst, + const wxString & history) + : wxDialog(parent, -1, title, + wxDefaultPosition, wxDefaultSize, + DIALOG_FLAGS) { - m = new Data (this, descr, flags, dst, history); + m = new Data(this, descr, flags, dst, history); } -DestinationDlg::DestinationDlg () - : wxDialog (), m (0) +DestinationDlg::DestinationDlg() + : wxDialog(), m(0) { } -DestinationDlg::~DestinationDlg () +DestinationDlg::~DestinationDlg() { if (m) delete m; } void -DestinationDlg::Create (wxWindow* parent, const wxString & title, - const wxString & descr, const int flags, - const wxString & dst, - const wxString & history) +DestinationDlg::Create(wxWindow* parent, const wxString & title, + const wxString & descr, const int flags, + const wxString & dst, + const wxString & history) { - wxDialog::Create (parent, -1, title, wxDefaultPosition, - wxDefaultSize, DIALOG_FLAGS); + wxDialog::Create(parent, -1, title, wxDefaultPosition, + wxDefaultSize, DIALOG_FLAGS); - m = new Data (this, descr, flags, dst, history); + m = new Data(this, descr, flags, dst, history); } const wxString & -DestinationDlg::GetDestination () const +DestinationDlg::GetDestination() const { return m->destination; } bool -DestinationDlg::GetForce () const +DestinationDlg::GetForce() const { return m->force; } diff --git a/src/destination_dlg.hpp b/src/destination_dlg.hpp index 4f46199d..cc795d82 100644 --- a/src/destination_dlg.hpp +++ b/src/destination_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -49,29 +49,29 @@ class DestinationDlg:public wxDialog * previous entries will be used instead of the edit * box @see HistoryValidator */ - DestinationDlg (wxWindow* parent, const wxString & title, - const wxString & descr = wxEmptyString, const int flags=0, - const wxString & dst = wxEmptyString, - const wxString & history = wxEmptyString); + DestinationDlg(wxWindow* parent, const wxString & title, + const wxString & descr = wxEmptyString, const int flags=0, + const wxString & dst = wxEmptyString, + const wxString & history = wxEmptyString); /** * default constructor. Use @a Create to initialize the dialog */ - DestinationDlg (); + DestinationDlg(); /** * destructor */ - virtual ~DestinationDlg (); + virtual ~DestinationDlg(); /** * initialize instance. See @a DestinationDlg for parameters */ void - Create (wxWindow* parent, const wxString & title, - const wxString & descr = wxEmptyString, const int flags=0, - const wxString & dst = wxEmptyString, - const wxString & history = wxEmptyString); + Create(wxWindow* parent, const wxString & title, + const wxString & descr = wxEmptyString, const int flags=0, + const wxString & dst = wxEmptyString, + const wxString & history = wxEmptyString); /** * get destination @@ -79,7 +79,7 @@ class DestinationDlg:public wxDialog * @return destination */ const wxString & - GetDestination () const; + GetDestination() const; /** * get the value of the "force" checkbox @@ -87,7 +87,7 @@ class DestinationDlg:public wxDialog * @return true=force/false=dont force */ bool - GetForce () const; + GetForce() const; private: /** @@ -96,7 +96,7 @@ class DestinationDlg:public wxDialog struct Data; Data * m; - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/diff_action.cpp b/src/diff_action.cpp index 361d57d1..3e3b2e50 100644 --- a/src/diff_action.cpp +++ b/src/diff_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -44,7 +44,7 @@ #include "preferences.hpp" #include "utils.hpp" -struct DiffAction::Data +struct DiffAction::Data { private: Action * action; @@ -54,57 +54,57 @@ struct DiffAction::Data DiffData diffData; wxWindow * parent; - Data (Action * action_, wxWindow * parent_) - : action (action_), showDialog (true), parent (parent_) + Data(Action * action_, wxWindow * parent_) + : action(action_), showDialog(true), parent(parent_) { } - Data (Action * action_, wxWindow * parent_, DiffData & data) - : action (action_), showDialog (false), diffData (data), parent (parent_) + Data(Action * action_, wxWindow * parent_, DiffData & data) + : action(action_), showDialog(false), diffData(data), parent(parent_) { } - svn::Context * - GetContext () + svn::Context * + GetContext() { - return action->GetContext (); + return action->GetContext(); } void - Trace (const wxString & msg) + Trace(const wxString & msg) { - action->Trace (msg); + action->Trace(msg); } /** * retrieves the revision information for a file */ svn::Revision - getRevision (const svn::Path & path, const svn::Status & status) + getRevision(const svn::Path & path, const svn::Status & status) { - svn::Entry entry (status.entry ()); - return entry.revision (); + svn::Entry entry(status.entry()); + return entry.revision(); } /** * retrieves the effective path for the first file */ - svn::Path - getPath1 (const svn::Path & path) + svn::Path + getPath1(const svn::Path & path) { if (diffData.useUrl1) - return PathUtf8 (diffData.url1); + return PathUtf8(diffData.url1); return path; } /** * retrieves the effective path for the second file */ - svn::Path - getPath2 (const svn::Path & path) + svn::Path + getPath2(const svn::Path & path) { if (diffData.useUrl2) - return PathUtf8 (diffData.url2); + return PathUtf8(diffData.url2); else return path; } @@ -124,8 +124,8 @@ struct DiffAction::Data * * 3. run the diff tool */ - void - diffTarget (const svn::Path & path) + void + diffTarget(const svn::Path & path) { svn::Path dstFile1, dstFile2; @@ -133,25 +133,25 @@ struct DiffAction::Data { case DiffData::WITH_BASE: dstFile1 = path; - dstFile2 = action->GetPathAsTempFile (getPath1 (path), svn::Revision::BASE); + dstFile2 = action->GetPathAsTempFile(getPath1(path), svn::Revision::BASE); break; case DiffData::WITH_HEAD: dstFile1 = path; - dstFile2 = action->GetPathAsTempFile (getPath1 (path), svn::Revision::HEAD); + dstFile2 = action->GetPathAsTempFile(getPath1(path), svn::Revision::HEAD); break; case DiffData::WITH_DIFFERENT_REVISION: dstFile1 = path; - dstFile2 = action->GetPathAsTempFile (getPath1 (path), diffData.revision1); + dstFile2 = action->GetPathAsTempFile(getPath1(path), diffData.revision1); break; case DiffData::TWO_REVISIONS: - dstFile1 = action->GetPathAsTempFile (getPath1 (path), diffData.revision1); - dstFile2 = action->GetPathAsTempFile (getPath2 (path), diffData.revision2); + dstFile1 = action->GetPathAsTempFile(getPath1(path), diffData.revision1); + dstFile2 = action->GetPathAsTempFile(getPath2(path), diffData.revision2); break; @@ -162,59 +162,59 @@ struct DiffAction::Data // prepare command line to execute Preferences prefs; - wxString args (prefs.diffToolArgs); - wxString dstFile1Native (Utf8ToLocal (dstFile1.native ().c_str ())); - wxString dstFile2Native (Utf8ToLocal (dstFile2.native ().c_str ())); + wxString args(prefs.diffToolArgs); + wxString dstFile1Native(Utf8ToLocal(dstFile1.native().c_str())); + wxString dstFile2Native(Utf8ToLocal(dstFile2.native().c_str())); - TrimString (args); + TrimString(args); - if (args.Length () == 0) - args.Printf (wxT("\"%s\" \"%s\""), dstFile1Native.c_str (), - dstFile2Native.c_str ()); + if (args.Length() == 0) + args.Printf(wxT("\"%s\" \"%s\""), dstFile1Native.c_str(), + dstFile2Native.c_str()); else { - args.Replace (wxT("%1"), dstFile1Native.c_str (), true); - args.Replace (wxT("%2"), dstFile2Native.c_str (), true); + args.Replace(wxT("%1"), dstFile1Native.c_str(), true); + args.Replace(wxT("%2"), dstFile2Native.c_str(), true); } - wxString cmd (prefs.diffTool + wxT(" ") + args); + wxString cmd(prefs.diffTool + wxT(" ") + args); wxString msg; - msg.Printf (_("Execute diff tool: %s"), cmd.c_str ()); - Trace (msg); + msg.Printf(_("Execute diff tool: %s"), cmd.c_str()); + Trace(msg); - ActionEvent::Post (parent, TOKEN_CMD_DIFF, cmd); + ActionEvent::Post(parent, TOKEN_CMD_DIFF, cmd); } }; -DiffAction::DiffAction (wxWindow * parent) - : Action (parent, _("Diff"), DONT_UPDATE) +DiffAction::DiffAction(wxWindow * parent) + : Action(parent, _("Diff"), DONT_UPDATE) { - m = new Data (this, parent); + m = new Data(this, parent); } -DiffAction::DiffAction (wxWindow * parent, DiffData & data) - : Action (parent, _("Diff"), DONT_UPDATE) +DiffAction::DiffAction(wxWindow * parent, DiffData & data) + : Action(parent, _("Diff"), DONT_UPDATE) { - m = new Data (this, parent, data); + m = new Data(this, parent, data); } -DiffAction::~DiffAction () +DiffAction::~DiffAction() { delete m; } bool -DiffAction::Prepare () +DiffAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) return false; Preferences prefs; - if (prefs.diffTool.Length () == 0) + if (prefs.diffTool.Length() == 0) { - TraceError (_("No diff tool set in the preferences")); + TraceError(_("No diff tool set in the preferences")); return false; } @@ -224,27 +224,27 @@ DiffAction::Prepare () // determine whether we are on a local // or remote location svn::Path target; - if (m->diffData.path.IsEmpty ()) + if (m->diffData.path.IsEmpty()) { - target = GetTarget (); + target = GetTarget(); } else { - target = PathUtf8 (m->diffData.path); + target = PathUtf8(m->diffData.path); } - bool isRemote = svn::Url::isValid (target.c_str ()); + bool isRemote = svn::Url::isValid(target.c_str()); // If there is more than one target, don't set the // default URL - wxString defaultUrl (wxEmptyString); - if (GetTargets ().size () == 1) - defaultUrl = Utf8ToLocal (target.c_str ()); - DiffDlg dlg (GetParent (), defaultUrl); + wxString defaultUrl(wxEmptyString); + if (GetTargets().size() == 1) + defaultUrl = Utf8ToLocal(target.c_str()); + DiffDlg dlg(GetParent(), defaultUrl); - size_t count = GetTargets ().size (); + size_t count = GetTargets().size(); if (count != 1) - dlg.EnableUrl (false); + dlg.EnableUrl(false); if (isRemote) { @@ -253,42 +253,42 @@ DiffAction::Prepare () DiffData::TWO_REVISIONS }; - dlg.AllowCompareTypes (types, WXSIZEOF (types)); + dlg.AllowCompareTypes(types, WXSIZEOF(types)); } - if( dlg.ShowModal () != wxID_OK ) + if (dlg.ShowModal() != wxID_OK) return false; - m->diffData = dlg.GetData (); + m->diffData = dlg.GetData(); } return true; } bool -DiffAction::Perform () +DiffAction::Perform() { - if (m->diffData.path.IsEmpty ()) + if (m->diffData.path.IsEmpty()) { - const std::vector & v = GetTargets (); + const std::vector & v = GetTargets(); std::vector::const_iterator it; - for (it=v.begin (); it != v.end (); it++) + for (it=v.begin(); it != v.end(); it++) { - m->diffTarget (*it); + m->diffTarget(*it); } } else { - svn::Path target = PathUtf8 (m->diffData.path); - m->diffTarget (target); + svn::Path target = PathUtf8(m->diffData.path); + m->diffTarget(target); } - + return true; } bool -DiffAction::CheckStatusSel (const svn::StatusSel & statusSel) +DiffAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/diff_action.hpp b/src/diff_action.hpp index e0c90bfb..73fc5a6f 100644 --- a/src/diff_action.hpp +++ b/src/diff_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -42,7 +42,7 @@ class DiffAction:public Action * * @param parent parent window */ - DiffAction (wxWindow * parent); + DiffAction(wxWindow * parent); /** * Constructor, that takes read configured @a DiffData, @@ -51,19 +51,19 @@ class DiffAction:public Action * @param parent parent window * @param data diff data */ - DiffAction (wxWindow * parent, DiffData & data); + DiffAction(wxWindow * parent, DiffData & data); /** Destructor */ - virtual ~DiffAction (); + virtual ~DiffAction(); - virtual bool - Perform (); - - virtual bool - Prepare (); + virtual bool + Perform(); + + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: struct Data; diff --git a/src/diff_data.hpp b/src/diff_data.hpp index 5ce1f613..03812d2a 100644 --- a/src/diff_data.hpp +++ b/src/diff_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -57,13 +57,13 @@ struct DiffData svn::Revision revision2; /** Constructor */ - DiffData (svn_opt_revision_kind kind = svn::Revision::BASE) - : compareType (WITH_BASE), - useUrl1 (false), url1 (wxEmptyString), - useUrl2 (false), url2 (wxEmptyString), - revision1 (kind) + DiffData(svn_opt_revision_kind kind = svn::Revision::BASE) + : compareType(WITH_BASE), + useUrl1(false), url1(wxEmptyString), + useUrl2(false), url2(wxEmptyString), + revision1(kind) { - if (kind != svn::Revision::BASE) + if (kind != svn::Revision::BASE) compareType = WITH_DIFFERENT_REVISION; } }; diff --git a/src/diff_dlg.cpp b/src/diff_dlg.cpp index 99e148d4..44b51f1c 100644 --- a/src/diff_dlg.cpp +++ b/src/diff_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -45,7 +45,7 @@ struct DiffDlg::Data DiffData diffData; wxComboBox * comboCompareTypes; - struct RevisionControls + struct RevisionControls { wxRadioButton * radioUseRevision; wxTextCtrl * textRevision; @@ -57,44 +57,44 @@ struct DiffDlg::Data } revCtrlsArray[2]; wxComboBox * comboCompare; - Data () - : enableUrl (true), compareTypesCount (0) + Data() + : enableUrl(true), compareTypesCount(0) { } bool - TransferRevisionFromWindow (int no, bool enabled, svn::Revision & revision) + TransferRevisionFromWindow(int no, bool enabled, svn::Revision & revision) { struct RevisionControls * revCtrls = &revCtrlsArray[no]; // first we enable/disable controls according to settings - revCtrls->radioUseRevision->Enable (enabled); - bool useRevision = enabled && revCtrls->radioUseRevision->GetValue (); - revCtrls->checkUseLatest->Enable (useRevision); - bool useLatest = useRevision && revCtrls->checkUseLatest->GetValue (); - revCtrls->textRevision->Enable (enabled && !useLatest); + revCtrls->radioUseRevision->Enable(enabled); + bool useRevision = enabled && revCtrls->radioUseRevision->GetValue(); + revCtrls->checkUseLatest->Enable(useRevision); + bool useLatest = useRevision && revCtrls->checkUseLatest->GetValue(); + revCtrls->textRevision->Enable(enabled && !useLatest); - revCtrls->radioUseDate->Enable (enabled); - bool useDate = enabled && revCtrls->radioUseDate->GetValue (); - revCtrls->datePicker->Enable (useDate); + revCtrls->radioUseDate->Enable(enabled); + bool useDate = enabled && revCtrls->radioUseDate->GetValue(); + revCtrls->datePicker->Enable(useDate); bool enablePath = enabled && enableUrl; - revCtrls->checkUsePath->Enable (enablePath); - bool usePath = enablePath && revCtrls->checkUsePath->GetValue (); - revCtrls->comboPath->Enable (usePath); + revCtrls->checkUsePath->Enable(enablePath); + bool usePath = enablePath && revCtrls->checkUsePath->GetValue(); + revCtrls->comboPath->Enable(usePath); // now transfer values bool isValid = true; - if (revCtrls->radioUseRevision->GetValue ()) + if (revCtrls->radioUseRevision->GetValue()) { - if (revCtrls->checkUseLatest->GetValue ()) - revision = svn::Revision (svn::Revision::HEAD); + if (revCtrls->checkUseLatest->GetValue()) + revision = svn::Revision(svn::Revision::HEAD); else { svn_revnum_t revnum; - bool isValidRevision = ParseRevision ( - revCtrls->textRevision->GetValue (), revnum); - revision = svn::Revision (revnum); + bool isValidRevision = ParseRevision( + revCtrls->textRevision->GetValue(), revnum); + revision = svn::Revision(revnum); if (enabled && !isValidRevision) isValid = false; @@ -103,44 +103,44 @@ struct DiffDlg::Data else { apr_time_t time=0; - apr_time_ansi_put ( - &time, revCtrls->datePicker->GetValue ().GetTicks ()); + apr_time_ansi_put( + &time, revCtrls->datePicker->GetValue().GetTicks()); svn::DateTime datetime(time); - revision = svn::Revision (datetime); + revision = svn::Revision(datetime); } return isValid; } - + /** * Add a compare type to the combo box */ void - AddCompareType (DiffData::CompareType compareType) + AddCompareType(DiffData::CompareType compareType) { compareTypes[compareTypesCount] = compareType; compareTypesCount++; - + switch (compareType) { case DiffData::WITH_BASE: - comboCompare->Append (_("Diff to BASE")); + comboCompare->Append(_("Diff to BASE")); break; case DiffData::WITH_HEAD: - comboCompare->Append (_("Diff to HEAD")); + comboCompare->Append(_("Diff to HEAD")); break; case DiffData::WITH_DIFFERENT_REVISION: - comboCompare->Append (_("Diff to another revision/date")); + comboCompare->Append(_("Diff to another revision/date")); break; case DiffData::TWO_REVISIONS: - comboCompare->Append (_("Diff two revisions/dates")); + comboCompare->Append(_("Diff two revisions/dates")); break; default: - comboCompare->Append (wxT("Invalid value")); + comboCompare->Append(wxT("Invalid value")); } } - + /** * Select @a CompareType in the combo-box. @@ -150,7 +150,7 @@ struct DiffDlg::Data * @retval true found! */ bool - SetCompareType (DiffData::CompareType compareType) + SetCompareType(DiffData::CompareType compareType) { bool found = false; @@ -159,7 +159,7 @@ struct DiffDlg::Data { if (compareTypes[i] == compareType) { - comboCompare->SetSelection (i); + comboCompare->SetSelection(i); found = true; break; } @@ -168,19 +168,19 @@ struct DiffDlg::Data if (!found) { diffData.compareType = compareTypes[0]; - comboCompare->SetSelection (0); + comboCompare->SetSelection(0); } return found; } }; -DiffDlg::DiffDlg (wxWindow * parent, const wxString & selectedUrl) - : DiffDlgBase (parent, -1, _("Diff"), wxDefaultPosition, - wxDefaultSize, wxDEFAULT_DIALOG_STYLE), - m (new Data ()) +DiffDlg::DiffDlg(wxWindow * parent, const wxString & selectedUrl) + : DiffDlgBase(parent, -1, _("Diff"), wxDefaultPosition, + wxDefaultSize, wxDEFAULT_DIALOG_STYLE), + m(new Data()) { - // Create the control mapping for the use + // Create the control mapping for the use // with @ref Data::SetRevision and @ref Data::GetRevision m->comboCompare = m_comboCompare; m->revCtrlsArray[0].radioUseRevision = m_radioUseRevision1; @@ -199,45 +199,45 @@ DiffDlg::DiffDlg (wxWindow * parent, const wxString & selectedUrl) m->revCtrlsArray[1].checkUsePath = m_checkUsePath2; m->revCtrlsArray[1].comboPath = m_comboPath2; - m_comboPath1->SetValue (selectedUrl); - m_comboPath2->SetValue (selectedUrl); - HistoryValidator valModule1 ( + m_comboPath1->SetValue(selectedUrl); + m_comboPath2->SetValue(selectedUrl); + HistoryValidator valModule1( HISTORY_DIFF_URL, &m->diffData.url1, true, true); - valModule1.SetWindow (this); - m_comboPath1->SetValidator (valModule1); + valModule1.SetWindow(this); + m_comboPath1->SetValidator(valModule1); - HistoryValidator valModule2 ( + HistoryValidator valModule2( HISTORY_DIFF_URL, &m->diffData.url2, true, true); - valModule2.SetWindow (this); + valModule2.SetWindow(this); - m_comboPath2->SetValidator (valModule2); + m_comboPath2->SetValidator(valModule2); - TransferDataToWindow (); + TransferDataToWindow(); - CentreOnParent (); + CentreOnParent(); // fill list - AllowCompareTypes (); - m->SetCompareType (DiffData::WITH_DIFFERENT_REVISION); - m_radioUseRevision1->SetValue (true); - m_radioUseRevision2->SetValue (true); + AllowCompareTypes(); + m->SetCompareType(DiffData::WITH_DIFFERENT_REVISION); + m_radioUseRevision1->SetValue(true); + m_radioUseRevision2->SetValue(true); - TransferDataFromWindow (); + TransferDataFromWindow(); } -DiffDlg::~DiffDlg () +DiffDlg::~DiffDlg() { delete m; } const DiffData -DiffDlg::GetData () const +DiffDlg::GetData() const { return m->diffData; } void -DiffDlg::EnableUrl (bool value) +DiffDlg::EnableUrl(bool value) { m->enableUrl = value; @@ -245,18 +245,18 @@ DiffDlg::EnableUrl (bool value) } void -DiffDlg::AllowCompareTypes (const DiffData::CompareType types [], - size_t count) +DiffDlg::AllowCompareTypes(const DiffData::CompareType types [], + size_t count) { if (count == 0) { - AllowCompareTypes (); + AllowCompareTypes(); return; } // remember old selection and clear contents DiffData::CompareType oldCompareType = m->diffData.compareType; - m_comboCompare->Clear (); + m_comboCompare->Clear(); m->compareTypesCount = 0; // otherwise allow only the types that were passed @@ -264,38 +264,38 @@ DiffDlg::AllowCompareTypes (const DiffData::CompareType types [], size_t i; for (i=0; iAddCompareType (types [i]); + m->AddCompareType(types [i]); // try to set old selection - m->SetCompareType (oldCompareType); - TransferDataFromWindow (); + m->SetCompareType(oldCompareType); + TransferDataFromWindow(); } void -DiffDlg::AllowCompareTypes () +DiffDlg::AllowCompareTypes() { // remember old selection and clear contents DiffData::CompareType oldCompareType = m->diffData.compareType; - m_comboCompare->Clear (); + m_comboCompare->Clear(); m->compareTypesCount = 0; - m->AddCompareType (DiffData::WITH_BASE); - m->AddCompareType (DiffData::WITH_HEAD); - m->AddCompareType (DiffData::WITH_DIFFERENT_REVISION); - m->AddCompareType (DiffData::TWO_REVISIONS); + m->AddCompareType(DiffData::WITH_BASE); + m->AddCompareType(DiffData::WITH_HEAD); + m->AddCompareType(DiffData::WITH_DIFFERENT_REVISION); + m->AddCompareType(DiffData::TWO_REVISIONS); - m->SetCompareType (oldCompareType); - TransferDataFromWindow (); + m->SetCompareType(oldCompareType); + TransferDataFromWindow(); } -bool -DiffDlg::TransferDataFromWindow () +bool +DiffDlg::TransferDataFromWindow() { bool revision1 = false; bool revision2 = false; - m->diffData.compareType = - m->compareTypes[m_comboCompare->GetSelection ()]; + m->diffData.compareType = + m->compareTypes[m_comboCompare->GetSelection()]; switch (m->diffData.compareType) { @@ -313,128 +313,128 @@ DiffDlg::TransferDataFromWindow () // retrieve revisions / dates bool isValid = true; - if (!m->TransferRevisionFromWindow ( + if (!m->TransferRevisionFromWindow( 0, revision1, m->diffData.revision1)) { isValid = false; } - if (!m->TransferRevisionFromWindow ( + if (!m->TransferRevisionFromWindow( 1, revision2, m->diffData.revision2)) { isValid = false; } - m->diffData.useUrl1 = m_checkUsePath1->GetValue (); - m->diffData.url1 = m_comboPath1->GetValue (); - m->diffData.useUrl2 = m_checkUsePath2->GetValue (); - m->diffData.url2 = m_comboPath2->GetValue (); + m->diffData.useUrl1 = m_checkUsePath1->GetValue(); + m->diffData.url1 = m_comboPath1->GetValue(); + m->diffData.useUrl2 = m_checkUsePath2->GetValue(); + m->diffData.url2 = m_comboPath2->GetValue(); + + m_buttonOK->Enable(isValid); - m_buttonOK->Enable (isValid); - return isValid; } - + void -DiffDlg::OnComboCompare (wxCommandEvent& event) +DiffDlg::OnComboCompare(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnRadioUseRevision1 (wxCommandEvent& event) +DiffDlg::OnRadioUseRevision1(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnTextRevision1 (wxCommandEvent& event) +DiffDlg::OnTextRevision1(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnCheckUseLatest1 (wxCommandEvent& event) +DiffDlg::OnCheckUseLatest1(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnRadioUseDate1 (wxCommandEvent& event) +DiffDlg::OnRadioUseDate1(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnDatePicker1( wxDateEvent& event ) +DiffDlg::OnDatePicker1(wxDateEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnUsePath1 (wxCommandEvent& event) +DiffDlg::OnUsePath1(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnComboPath1 (wxCommandEvent& event) +DiffDlg::OnComboPath1(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnRadioUseRevision2 (wxCommandEvent& event) +DiffDlg::OnRadioUseRevision2(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnTextRevision2 (wxCommandEvent& event) +DiffDlg::OnTextRevision2(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnCheckUseLatest2 (wxCommandEvent& event) +DiffDlg::OnCheckUseLatest2(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnRadioUseDate2 (wxCommandEvent& event) +DiffDlg::OnRadioUseDate2(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnDatePicker2 (wxDateEvent& event) +DiffDlg::OnDatePicker2(wxDateEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnCheckUsePath2 (wxCommandEvent& event) +DiffDlg::OnCheckUsePath2(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } void -DiffDlg::OnComboPath2 (wxCommandEvent& event) +DiffDlg::OnComboPath2(wxCommandEvent& event) { - TransferDataFromWindow (); + TransferDataFromWindow(); } -void -DiffDlg::OnButtonOK (wxCommandEvent& event) +void +DiffDlg::OnButtonOK(wxCommandEvent& event) { - TheHistoryManager.AddEntryToList (HISTORY_DIFF_URL, - m_comboPath1->GetValue ()); - TheHistoryManager.AddEntryToList (HISTORY_DIFF_URL, - m_comboPath2->GetValue ()); + TheHistoryManager.AddEntryToList(HISTORY_DIFF_URL, + m_comboPath1->GetValue()); + TheHistoryManager.AddEntryToList(HISTORY_DIFF_URL, + m_comboPath2->GetValue()); - event.Skip (); + event.Skip(); } /* ----------------------------------------------------------------- diff --git a/src/diff_dlg.hpp b/src/diff_dlg.hpp index 737b91a3..df5fef35 100644 --- a/src/diff_dlg.hpp +++ b/src/diff_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -48,19 +48,19 @@ class DiffDlg : public DiffDlgBase * * @param parent parent window */ - DiffDlg (wxWindow *parent, const wxString & selectedUrl); + DiffDlg(wxWindow *parent, const wxString & selectedUrl); /** * destructor */ - virtual ~DiffDlg (); + virtual ~DiffDlg(); /** * returns the data the user has entered */ const DiffData - GetData () const; + GetData() const; /** @@ -69,7 +69,7 @@ class DiffDlg : public DiffDlgBase * @param value true=enabled; false=disabled */ void - EnableUrl (bool value); + EnableUrl(bool value); /** @@ -83,36 +83,36 @@ class DiffDlg : public DiffDlgBase * @param count count of entries in @a types */ void - AllowCompareTypes (const DiffData::CompareType types [], - size_t count); + AllowCompareTypes(const DiffData::CompareType types [], + size_t count); /** * Allow all compare-types */ void - AllowCompareTypes (); + AllowCompareTypes(); - virtual bool TransferDataFromWindow (); + virtual bool TransferDataFromWindow(); protected: // Event handlers - virtual void OnComboCompare (wxCommandEvent& event); - virtual void OnRadioUseRevision1 (wxCommandEvent& event); - virtual void OnTextRevision1 (wxCommandEvent& event); - virtual void OnCheckUseLatest1 (wxCommandEvent& event); - virtual void OnRadioUseDate1 (wxCommandEvent& event); - virtual void OnDatePicker1( wxDateEvent& event ); - virtual void OnUsePath1 (wxCommandEvent& event); - virtual void OnComboPath1 (wxCommandEvent& event); - virtual void OnRadioUseRevision2 (wxCommandEvent& event); - virtual void OnTextRevision2 (wxCommandEvent& event); - virtual void OnCheckUseLatest2 (wxCommandEvent& event); - virtual void OnRadioUseDate2 (wxCommandEvent& event); - virtual void OnDatePicker2 (wxDateEvent& event ); - virtual void OnCheckUsePath2 (wxCommandEvent& event); - virtual void OnComboPath2 (wxCommandEvent& event); - virtual void OnButtonOK (wxCommandEvent& event); - + virtual void OnComboCompare(wxCommandEvent& event); + virtual void OnRadioUseRevision1(wxCommandEvent& event); + virtual void OnTextRevision1(wxCommandEvent& event); + virtual void OnCheckUseLatest1(wxCommandEvent& event); + virtual void OnRadioUseDate1(wxCommandEvent& event); + virtual void OnDatePicker1(wxDateEvent& event); + virtual void OnUsePath1(wxCommandEvent& event); + virtual void OnComboPath1(wxCommandEvent& event); + virtual void OnRadioUseRevision2(wxCommandEvent& event); + virtual void OnTextRevision2(wxCommandEvent& event); + virtual void OnCheckUseLatest2(wxCommandEvent& event); + virtual void OnRadioUseDate2(wxCommandEvent& event); + virtual void OnDatePicker2(wxDateEvent& event); + virtual void OnCheckUsePath2(wxCommandEvent& event); + virtual void OnComboPath2(wxCommandEvent& event); + virtual void OnButtonOK(wxCommandEvent& event); + private: /** hide implementation details */ struct Data; diff --git a/src/dnd_dlg.cpp b/src/dnd_dlg.cpp index 7accd38e..df8e19f8 100644 --- a/src/dnd_dlg.cpp +++ b/src/dnd_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -26,17 +26,17 @@ #include "dnd_dlg.hpp" -BEGIN_EVENT_TABLE (DragAndDropDialog, wxDialog) - EVT_BUTTON (ID_BUTTON_IMPORT, DragAndDropDialog::OnImport) - EVT_BUTTON (ID_BUTTON_MOVE, DragAndDropDialog::OnMove) - EVT_BUTTON (ID_BUTTON_COPY, DragAndDropDialog::OnCopy) - EVT_BUTTON (wxID_CANCEL, DragAndDropDialog::OnCancel) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(DragAndDropDialog, wxDialog) + EVT_BUTTON(ID_BUTTON_IMPORT, DragAndDropDialog::OnImport) + EVT_BUTTON(ID_BUTTON_MOVE, DragAndDropDialog::OnMove) + EVT_BUTTON(ID_BUTTON_COPY, DragAndDropDialog::OnCopy) + EVT_BUTTON(wxID_CANCEL, DragAndDropDialog::OnCancel) +END_EVENT_TABLE() -DragAndDropDialog::DragAndDropDialog (wxWindow *parent, wxString src, wxString dest, bool showMove, bool showImport) -: wxDialog(parent, -1, ((showImport) ? _("Import") : _("Copy/Move")), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +DragAndDropDialog::DragAndDropDialog(wxWindow *parent, wxString src, wxString dest, bool showMove, bool showImport) + : wxDialog(parent, -1, ((showImport) ? _("Import") : _("Copy/Move")), + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { m_decision = wxID_CANCEL; m_src = src; @@ -44,16 +44,16 @@ DragAndDropDialog::DragAndDropDialog (wxWindow *parent, wxString src, wxString d m_showImport = showImport; m_showMove = showMove; - CreateControls (); + CreateControls(); } void -DragAndDropDialog::CreateControls () +DragAndDropDialog::CreateControls() { wxString msg; if (m_showImport) { - const wxString fmt (_("\ + const wxString fmt(_("\ Are you sure that you want to import\n\ \n\ %s\n\ @@ -61,12 +61,12 @@ Are you sure that you want to import\n\ into\n\ \n\ %s?")); - msg = wxString::Format ( - fmt, m_src.c_str (), m_dest.c_str ()); + msg = wxString::Format( + fmt, m_src.c_str(), m_dest.c_str()); } else { - const wxString fmt (_("\ + const wxString fmt(_("\ Would you like to move or copy\n\ \n\ \n\ @@ -75,8 +75,8 @@ Would you like to move or copy\n\ into\n\ \n\ %s?")); - msg = wxString::Format ( - fmt, m_src.c_str (), m_dest.c_str ()); + msg = wxString::Format( + fmt, m_src.c_str(), m_dest.c_str()); } DragAndDropDialog* itemDialog1 = this; @@ -84,32 +84,32 @@ into\n\ wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); itemDialog1->SetSizer(itemBoxSizer2); - wxStaticText* itemStaticText3 = new wxStaticText( itemDialog1, wxID_STATIC, msg, wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* itemStaticText3 = new wxStaticText(itemDialog1, wxID_STATIC, msg, wxDefaultPosition, wxDefaultSize, 0); itemBoxSizer2->Add(itemStaticText3, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5); - itemBoxSizer2->AddSpacer (10); + itemBoxSizer2->AddSpacer(10); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); if (m_showImport) { - wxButton* itemButton5 = new wxButton( itemDialog1, ID_BUTTON_IMPORT, _("Import"), wxDefaultPosition, wxDefaultSize, 0 ); + wxButton* itemButton5 = new wxButton(itemDialog1, ID_BUTTON_IMPORT, _("Import"), wxDefaultPosition, wxDefaultSize, 0); itemBoxSizer4->Add(itemButton5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); } else { if (m_showMove) { - wxButton* itemButton5 = new wxButton( itemDialog1, ID_BUTTON_MOVE, _("Move"), wxDefaultPosition, wxDefaultSize, 0 ); + wxButton* itemButton5 = new wxButton(itemDialog1, ID_BUTTON_MOVE, _("Move"), wxDefaultPosition, wxDefaultSize, 0); itemBoxSizer4->Add(itemButton5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); } - wxButton* itemButton6 = new wxButton( itemDialog1, ID_BUTTON_COPY, _("Copy"), wxDefaultPosition, wxDefaultSize, 0 ); + wxButton* itemButton6 = new wxButton(itemDialog1, ID_BUTTON_COPY, _("Copy"), wxDefaultPosition, wxDefaultSize, 0); itemBoxSizer4->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); } - wxButton* itemButton7 = new wxButton (itemDialog1, wxID_CANCEL, _("Cancel")); + wxButton* itemButton7 = new wxButton(itemDialog1, wxID_CANCEL, _("Cancel")); itemBoxSizer4->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); GetSizer()->Fit(this); @@ -117,31 +117,31 @@ into\n\ } void -DragAndDropDialog::OnImport (wxCommandEvent & event) +DragAndDropDialog::OnImport(wxCommandEvent & event) { m_decision = DragAndDropDialog::RESULT_IMPORT; - EndModal (m_decision); + EndModal(m_decision); } void -DragAndDropDialog::OnMove (wxCommandEvent & event) +DragAndDropDialog::OnMove(wxCommandEvent & event) { m_decision = DragAndDropDialog::RESULT_MOVE; - EndModal (m_decision); + EndModal(m_decision); } void -DragAndDropDialog::OnCopy (wxCommandEvent & event) +DragAndDropDialog::OnCopy(wxCommandEvent & event) { m_decision = DragAndDropDialog::RESULT_COPY; - EndModal (m_decision); + EndModal(m_decision); } void -DragAndDropDialog::OnCancel (wxCommandEvent & event) +DragAndDropDialog::OnCancel(wxCommandEvent & event) { m_decision = DragAndDropDialog::RESULT_CANCEL; - EndModal (m_decision); + EndModal(m_decision); } /* ----------------------------------------------------------------- diff --git a/src/dnd_dlg.hpp b/src/dnd_dlg.hpp index b0a8ebe1..1a7259e1 100644 --- a/src/dnd_dlg.hpp +++ b/src/dnd_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,8 +39,8 @@ enum class DragAndDropDialog : public wxDialog { public: - DragAndDropDialog (wxWindow *parent, wxString src, wxString dest, bool bShowMove = true, bool bShowImport = false); - int GetDecision (); + DragAndDropDialog(wxWindow *parent, wxString src, wxString dest, bool bShowMove = true, bool bShowImport = false); + int GetDecision(); enum { RESULT_CANCEL = 1, @@ -50,19 +50,19 @@ class DragAndDropDialog : public wxDialog }; void - OnImport (wxCommandEvent & event); + OnImport(wxCommandEvent & event); void - OnMove (wxCommandEvent & event); + OnMove(wxCommandEvent & event); void - OnCopy (wxCommandEvent & event); + OnCopy(wxCommandEvent & event); void - OnCancel (wxCommandEvent & event); + OnCancel(wxCommandEvent & event); private: - void CreateControls (); + void CreateControls(); int m_decision; wxString m_src; @@ -70,7 +70,7 @@ class DragAndDropDialog : public wxDialog bool m_showImport; bool m_showMove; - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/drag_n_drop_action.cpp b/src/drag_n_drop_action.cpp index b5d96541..70c54d15 100644 --- a/src/drag_n_drop_action.cpp +++ b/src/drag_n_drop_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -43,54 +43,54 @@ class DragAndDropImportTraverser : public wxDirTraverser { public: - DragAndDropImportTraverser (const wxString& rootSrcDir, - const wxString& destDir) + DragAndDropImportTraverser(const wxString& rootSrcDir, + const wxString& destDir) { m_rootSrcDir = rootSrcDir; m_destDir = destDir; // Create the initial destionation directory - wxString newDirectory = wxFileName (m_destDir).GetFullPath (); - if (::wxDirExists (newDirectory) == false) + wxString newDirectory = wxFileName(m_destDir).GetFullPath(); + if (::wxDirExists(newDirectory) == false) { - ::wxMkdir (newDirectory); + ::wxMkdir(newDirectory); } } - virtual wxDirTraverseResult OnFile (const wxString& filename) + virtual wxDirTraverseResult OnFile(const wxString& filename) { // ::wxCopyFile (filename, (destDir + dirname - rootSrcDir)) - ::wxCopyFile (filename, ConvertToDestinationPath (filename)); + ::wxCopyFile(filename, ConvertToDestinationPath(filename)); return wxDIR_CONTINUE; } - virtual wxDirTraverseResult OnDir (const wxString& dirname) + virtual wxDirTraverseResult OnDir(const wxString& dirname) { // ::wxMkDir (destDir + (dirname - rootSrcDir)) - wxString newDirectory = ConvertToDestinationPath (dirname); - if (::wxDirExists (newDirectory) == false) + wxString newDirectory = ConvertToDestinationPath(dirname); + if (::wxDirExists(newDirectory) == false) { - ::wxMkdir (newDirectory); + ::wxMkdir(newDirectory); } return wxDIR_CONTINUE; } private: - wxString ConvertToDestinationPath (const wxString& fullPath) + wxString ConvertToDestinationPath(const wxString& fullPath) { - return wxFileName (m_destDir + wxFileName::GetPathSeparator () + - fullPath.Mid (m_destDir.Len ()-1)).GetFullPath (); + return wxFileName(m_destDir + wxFileName::GetPathSeparator() + + fullPath.Mid(m_destDir.Len()-1)).GetFullPath(); } wxString m_rootSrcDir; wxString m_destDir; }; -DragAndDropAction::DragAndDropAction (wxWindow * parent, - DragAndDropData & data) - : Action (parent, wxEmptyString, 0), - m_parent (parent) +DragAndDropAction::DragAndDropAction(wxWindow * parent, + DragAndDropData & data) + : Action(parent, wxEmptyString, 0), + m_parent(parent) { m = new DragAndDropData(); m->m_files = data.m_files; @@ -100,7 +100,7 @@ DragAndDropAction::DragAndDropAction (wxWindow * parent, m->m_recursiveAdd = false; } -DragAndDropAction::~DragAndDropAction () +DragAndDropAction::~DragAndDropAction() { delete m; } @@ -119,25 +119,25 @@ DragAndDropAction::IsInSameTree(const wxString & srcPath, const wxString & destP size_t destlen = destPath.Len(); if (destlen < limit) limit = destlen; - + size_t i; for (i = 0; i < limit; i++) { if (srcPath[i] != destPath[i]) break; } - const wxString matching = srcPath.SubString (0, i); - int last_slash = matching.Find (wxT('/'), true); + const wxString matching = srcPath.SubString(0, i); + int last_slash = matching.Find(wxT('/'), true); #ifdef __WXMSW__ if (last_slash == wxNOT_FOUND) - last_slash = matching.Find (wxT('\\'), true); + last_slash = matching.Find(wxT('\\'), true); #endif if (last_slash == wxNOT_FOUND) return false; - const svn::Path base = PathUtf8 (matching.SubString (0, last_slash-1)); - + const svn::Path base = PathUtf8(matching.SubString(0, last_slash-1)); + // 1. If base path is local folder which is not WC, srcPath and destPath - // are in different WC folders each other. + // are in different WC folders each other. if (!base.isUrl() && !svn::Wc::checkWc(base.c_str())) return false; @@ -145,33 +145,33 @@ DragAndDropAction::IsInSameTree(const wxString & srcPath, const wxString & destP } bool -DragAndDropAction::Prepare () +DragAndDropAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } wxString src = wxEmptyString; - if (m->m_files.GetCount () > 1) + if (m->m_files.GetCount() > 1) src = _("Multiple Files"); - else if (m->m_files.GetCount () == 1) + else if (m->m_files.GetCount() == 1) src = m->m_files[0]; else return false; // No files dragged - // If the ctrl key is down, then assume the user + // If the ctrl key is down, then assume the user // wants to copy rather than move files - bool showMoveButton = (::wxGetKeyState (WXK_CONTROL) == false); + bool showMoveButton = (::wxGetKeyState(WXK_CONTROL) == false); - // Check if the file being dragged-and-dropped is already + // Check if the file being dragged-and-dropped is already // under source control or is being imported into the repository - svn::Path srcSvnPath (PathUtf8 (m->m_files[0])); - svn::Path destSvnPath (PathUtf8 (m->m_destination)); + svn::Path srcSvnPath(PathUtf8(m->m_files[0])); + svn::Path destSvnPath(PathUtf8(m->m_destination)); bool importFiles = false; bool incrementRevision = false; - + // ==DragDrop action patterns== // Any entry -> Same folder : Nothing to be done // Any folder -> Itself : Unexpected! @@ -185,24 +185,24 @@ DragAndDropAction::Prepare () // WC folder -> Other working copy : Unexpected! // WC file -> Other working copy : Add action (called as import but uncommitied) // Plain file -> WC folder : Add action (called as import but uncommitied) - + wxArrayString::iterator it; - for (it = m->m_files.begin (); it != m->m_files.end(); it++) + for (it = m->m_files.begin(); it != m->m_files.end(); it++) { - if (Utf8ToLocal (PathUtf8 (*it).dirpath ()) == - Utf8ToLocal (PathUtf8 (m->m_destination).c_str ())) + if (Utf8ToLocal(PathUtf8(*it).dirpath()) == + Utf8ToLocal(PathUtf8(m->m_destination).c_str())) return false; if (*it == m->m_destination) return false; } - - if (destSvnPath.isUrl ()) + + if (destSvnPath.isUrl()) { //Drop into repository. - if (srcSvnPath.isUrl ()) + if (srcSvnPath.isUrl()) { - if (!IsInSameTree (m->m_files[0], m->m_destination)) + if (!IsInSameTree(m->m_files[0], m->m_destination)) return false; importFiles = false; @@ -210,10 +210,10 @@ DragAndDropAction::Prepare () } else { - for (it = m->m_files.begin (); it != m->m_files.end(); it++) + for (it = m->m_files.begin(); it != m->m_files.end(); it++) { - if (svn::Wc::checkWc (PathUtf8 (*it))) - return false; + if (svn::Wc::checkWc(PathUtf8(*it))) + return false; } importFiles = true; @@ -224,18 +224,18 @@ DragAndDropAction::Prepare () { //Drop into working copy. - if (srcSvnPath.isUrl ()) + if (srcSvnPath.isUrl()) return false; - else if (svn::Wc::checkWc (srcSvnPath.dirpath ()) && - IsInSameTree (m->m_files[0], m->m_destination)) + else if (svn::Wc::checkWc(srcSvnPath.dirpath()) && + IsInSameTree(m->m_files[0], m->m_destination)) { importFiles = false; incrementRevision = false; } else { - for (it = m->m_files.begin (); it != m->m_files.end(); it++) + for (it = m->m_files.begin(); it != m->m_files.end(); it++) { - if (svn::Wc::checkWc (PathUtf8 (*it))) + if (svn::Wc::checkWc(PathUtf8(*it))) return false; } @@ -246,9 +246,9 @@ DragAndDropAction::Prepare () } // Present the confirmation dialog to the user - DragAndDropDialog dlg (m_parent, src, m->m_destination, - showMoveButton, importFiles); - m->m_action = dlg.ShowModal (); + DragAndDropDialog dlg(m_parent, src, m->m_destination, + showMoveButton, importFiles); + m->m_action = dlg.ShowModal(); if (DragAndDropDialog::RESULT_CANCEL == m->m_action) return false; @@ -257,85 +257,85 @@ DragAndDropAction::Prepare () // so present the commit dialog to get that information if (DragAndDropDialog::RESULT_IMPORT == m->m_action && incrementRevision) { - CommitDlg commitDlg (m_parent); - if (commitDlg.ShowModal () != wxID_OK) + CommitDlg commitDlg(m_parent); + if (commitDlg.ShowModal() != wxID_OK) return false; - m->m_logMessage = commitDlg.GetMessage (); - m->m_recursiveAdd = commitDlg.GetRecursive (); + m->m_logMessage = commitDlg.GetMessage(); + m->m_recursiveAdd = commitDlg.GetRecursive(); } return true; } bool -DragAndDropAction::Perform () +DragAndDropAction::Perform() { - ::wxBusyCursor (); + ::wxBusyCursor(); svn::Revision unusedRevision; - svn::Client client (GetContext ()); + svn::Client client(GetContext()); wxString msg = wxEmptyString; for (unsigned int i=0; im_files.GetCount(); i++) { - svn::Path srcPath = PathUtf8 (m->m_files [i]); - wxFileName srcFilename (m->m_files[i]); - svn::Path destPath = PathUtf8 (m->m_destination); - destPath.addComponent (LocalToUtf8 (srcFilename.GetFullName ())); + svn::Path srcPath = PathUtf8(m->m_files [i]); + wxFileName srcFilename(m->m_files[i]); + svn::Path destPath = PathUtf8(m->m_destination); + destPath.addComponent(LocalToUtf8(srcFilename.GetFullName())); switch (m->m_action) { case DragAndDropDialog::RESULT_COPY: - msg.Printf (_("Copying file: %s"), PathToNative (srcPath).c_str ()); - Trace (msg); - client.copy (srcPath, unusedRevision, destPath); + msg.Printf(_("Copying file: %s"), PathToNative(srcPath).c_str()); + Trace(msg); + client.copy(srcPath, unusedRevision, destPath); break; case DragAndDropDialog::RESULT_MOVE: - msg.Printf (_("Moving file: %s"), PathToNative (srcPath).c_str ()); - Trace (msg); - client.move (srcPath, unusedRevision, destPath, false); + msg.Printf(_("Moving file: %s"), PathToNative(srcPath).c_str()); + Trace(msg); + client.move(srcPath, unusedRevision, destPath, false); break; case DragAndDropDialog::RESULT_IMPORT: // Imports only work when the destination directory is a URL. // For imports into a WC, copy the files to the WC and mark // them to be added to the repository - if (destPath.isUrl ()) + if (destPath.isUrl()) { - msg.Printf (_("Importing file into repository: %s"), - PathToNative (srcPath).c_str ()); - Trace (msg); - client.import (srcPath, destPath, - LocalToUtf8(m->m_logMessage).c_str (), - srcFilename.IsDir () && m->m_recursiveAdd); + msg.Printf(_("Importing file into repository: %s"), + PathToNative(srcPath).c_str()); + Trace(msg); + client.import(srcPath, destPath, + LocalToUtf8(m->m_logMessage).c_str(), + srcFilename.IsDir() && m->m_recursiveAdd); } else { // If the src file is just a file, then use ::wxCopyFile // otherwise is wxDirTraverser to copy the whole directory - msg.Printf (_("Copying file into working directory: %s"), - PathToNative (srcPath).c_str ()); - Trace (msg); - if (::wxDirExists (m->m_files [i])) + msg.Printf(_("Copying file into working directory: %s"), + PathToNative(srcPath).c_str()); + Trace(msg); + if (::wxDirExists(m->m_files [i])) { - msg.Printf (_("Adding directory to repository: %s"), - PathToNative (srcPath).c_str ()); - wxDir dir (m->m_files [i]); - if (dir.IsOpened ()) + msg.Printf(_("Adding directory to repository: %s"), + PathToNative(srcPath).c_str()); + wxDir dir(m->m_files [i]); + if (dir.IsOpened()) { - DragAndDropImportTraverser dirTraverser ( - m->m_files [i], PathToNative (destPath)); - dir.Traverse (dirTraverser); + DragAndDropImportTraverser dirTraverser( + m->m_files [i], PathToNative(destPath)); + dir.Traverse(dirTraverser); } } else { - wxString srcNative (PathToNative (srcPath)); - msg.Printf (_("Adding file to repository: %s"), - srcNative.c_str ()); - ::wxCopyFile (srcNative, - PathToNative (destPath)); + wxString srcNative(PathToNative(srcPath)); + msg.Printf(_("Adding file to repository: %s"), + srcNative.c_str()); + ::wxCopyFile(srcNative, + PathToNative(destPath)); } - Trace (msg); - client.add (destPath, m->m_recursiveAdd); + Trace(msg); + client.add(destPath, m->m_recursiveAdd); } break; case DragAndDropDialog::RESULT_CANCEL: @@ -349,7 +349,7 @@ DragAndDropAction::Perform () } bool -DragAndDropAction::CheckStatusSel (const svn::StatusSel & statusSel) +DragAndDropAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/drag_n_drop_action.hpp b/src/drag_n_drop_action.hpp index 0cadda66..ee71cb43 100644 --- a/src/drag_n_drop_action.hpp +++ b/src/drag_n_drop_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -52,25 +52,25 @@ class DragAndDropAction : public Action * @param parent parent window * @param type kind of action (MOVE_MOVE, MOVE_COPY) */ - DragAndDropAction (wxWindow * parent, DragAndDropData & data); - + DragAndDropAction(wxWindow * parent, DragAndDropData & data); + virtual ~DragAndDropAction(); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: wxWindow * m_parent; DragAndDropData * m; - + bool - IsInSameTree (const wxString & srcPath, const wxString & destPath); + IsInSameTree(const wxString & srcPath, const wxString & destPath); }; #endif diff --git a/src/drag_n_drop_data.hpp b/src/drag_n_drop_data.hpp index 797a3c05..bd35efc8 100644 --- a/src/drag_n_drop_data.hpp +++ b/src/drag_n_drop_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/src/exceptions.cpp b/src/exceptions.cpp index 951fb2bb..d9964cd9 100644 --- a/src/exceptions.cpp +++ b/src/exceptions.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -28,13 +28,13 @@ // app #include "exceptions.hpp" -RapidSvnEx::RapidSvnEx (const wxString & __estr, const long __code) +RapidSvnEx::RapidSvnEx(const wxString & __estr, const long __code) { code = __code; - what (__estr); + what(__estr); } -RapidSvnEx::~RapidSvnEx () +RapidSvnEx::~RapidSvnEx() { } @@ -50,9 +50,9 @@ RapidSvnEx & RapidSvnEx::operator = (const RapidSvnEx & rhs) } void -RapidSvnEx::what (const wxString & __what) +RapidSvnEx::what(const wxString & __what) { - estr.Printf (_("%s code: %ld"), __what.c_str (), code); + estr.Printf(_("%s code: %ld"), __what.c_str(), code); } /* ----------------------------------------------------------------- * local variables: diff --git a/src/exceptions.hpp b/src/exceptions.hpp index c4df98d7..70b548e4 100644 --- a/src/exceptions.hpp +++ b/src/exceptions.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,25 +34,25 @@ class RapidSvnEx long code; public: - RapidSvnEx (const wxString & __estr = wxEmptyString, const long __code = -1); + RapidSvnEx(const wxString & __estr = wxEmptyString, const long __code = -1); - virtual ~ RapidSvnEx (); + virtual ~ RapidSvnEx(); - RapidSvnEx (const RapidSvnEx & rhs) + RapidSvnEx(const RapidSvnEx & rhs) { *this = rhs; } RapidSvnEx & operator = (const RapidSvnEx & rhs); - void what (const wxString & __estr); + void what(const wxString & __estr); - virtual const wxChar *what () const + virtual const wxChar *what() const { - return estr.c_str (); + return estr.c_str(); } - const wxString & str (void) const + const wxString & str(void) const { return estr; } diff --git a/src/export_action.cpp b/src/export_action.cpp index 034846c3..52b10059 100644 --- a/src/export_action.cpp +++ b/src/export_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,57 +36,57 @@ #include "ids.hpp" #include "utils.hpp" -ExportAction::ExportAction (wxWindow * parent) - :Action (parent, _("Export"), DONT_UPDATE) +ExportAction::ExportAction(wxWindow * parent) + :Action(parent, _("Export"), DONT_UPDATE) { } bool -ExportAction::Prepare () +ExportAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - const std::vector & v = GetTargets (); + const std::vector & v = GetTargets(); - svn::Path selectedPath (""); + svn::Path selectedPath(""); - if (v.size () == 1) + if (v.size() == 1) { selectedPath = v [0]; } - ExportDlg dlg (GetParent (), selectedPath); + ExportDlg dlg(GetParent(), selectedPath); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - m_data = dlg.GetData (); + m_data = dlg.GetData(); return true; } bool -ExportAction::Perform () +ExportAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); TrimString(m_data.DestPath); UnixPath(m_data.DestPath); TrimString(m_data.SrcPath); long revnum = -1; - svn::Revision revision (svn::Revision::HEAD); + svn::Revision revision(svn::Revision::HEAD); svn::Revision pegRevision; // Did the user request a specific revision?: if (!m_data.UseLatest) { TrimString(m_data.Revision); - if (!m_data.Revision.IsEmpty ()) + if (!m_data.Revision.IsEmpty()) { m_data.Revision.ToLong(&revnum, 10); // If this fails, revnum is unchanged. } @@ -98,32 +98,32 @@ ExportAction::Perform () if (!m_data.NotSpecified) { TrimString(m_data.PegRevision); - if (!m_data.PegRevision.IsEmpty ()) + if (!m_data.PegRevision.IsEmpty()) { m_data.PegRevision.ToLong(&revnum, 10); // If this fails, revnum is unchanged. } if (revnum != -1) pegRevision = svn::Revision(revnum); } - - wxSetWorkingDirectory (m_data.DestPath); - - svn::Path srcPathUtf8 (PathUtf8 (m_data.SrcPath)); - svn::Path destPathUtf8 (PathUtf8 (m_data.DestPath)); - - client.doExport (srcPathUtf8.c_str (), - destPathUtf8, - revision, - m_data.Overwrite, - pegRevision, - m_data.IgnoreExternals, - m_data.Recursive, - m_data.Eol); + + wxSetWorkingDirectory(m_data.DestPath); + + svn::Path srcPathUtf8(PathUtf8(m_data.SrcPath)); + svn::Path destPathUtf8(PathUtf8(m_data.DestPath)); + + client.doExport(srcPathUtf8.c_str(), + destPathUtf8, + revision, + m_data.Overwrite, + pegRevision, + m_data.IgnoreExternals, + m_data.Recursive, + m_data.Eol); return true; } bool -ExportAction::CheckStatusSel (const svn::StatusSel & statusSel) +ExportAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/export_action.hpp b/src/export_action.hpp index 1b3e7beb..d0f01e07 100644 --- a/src/export_action.hpp +++ b/src/export_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,16 +37,16 @@ namespace svn class ExportAction : public Action { public: - ExportAction (wxWindow * parent); + ExportAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: ExportData m_data; diff --git a/src/export_data.hpp b/src/export_data.hpp index f190a243..f8c01f38 100644 --- a/src/export_data.hpp +++ b/src/export_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -32,7 +32,7 @@ */ struct ExportData { - ExportData () + ExportData() { UseLatest = true; NotSpecified = true; diff --git a/src/export_dlg.cpp b/src/export_dlg.cpp index 3601e8c3..aadaa1f8 100644 --- a/src/export_dlg.cpp +++ b/src/export_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -61,73 +61,73 @@ struct ExportDlg::Data public: ExportData data; - Data (wxWindow * wnd) + Data(wxWindow * wnd) { // create controls wxStaticBox* urlBox = - new wxStaticBox (wnd, 0, _("URL")); - HistoryValidator valModule (HISTORY_REPOSITORY, &data.SrcPath); + new wxStaticBox(wnd, 0, _("URL")); + HistoryValidator valModule(HISTORY_REPOSITORY, &data.SrcPath); m_comboSrcPath = - new wxComboBox (wnd, -1, wxEmptyString, wxDefaultPosition, - wxSize (235, -1), 0, 0, wxCB_DROPDOWN, valModule); - m_comboSrcPath->SetHelpText (_("Enter the repository URL (not local path) here.")); + new wxComboBox(wnd, -1, wxEmptyString, wxDefaultPosition, + wxSize(235, -1), 0, 0, wxCB_DROPDOWN, valModule); + m_comboSrcPath->SetHelpText(_("Enter the repository URL (not local path) here.")); wxStaticBox* destBox = - new wxStaticBox (wnd, 0, _("Destination Directory")); - wxTextValidator valDestPath (wxFILTER_NONE, &data.DestPath); + new wxStaticBox(wnd, 0, _("Destination Directory")); + wxTextValidator valDestPath(wxFILTER_NONE, &data.DestPath); m_textDestPath = - new wxTextCtrl (wnd, -1, wxEmptyString, wxDefaultPosition, - wxSize(205, -1), 0, valDestPath); - m_textDestPath->SetHelpText (_("Enter the local path where you want the code be exported.")); + new wxTextCtrl(wnd, -1, wxEmptyString, wxDefaultPosition, + wxSize(205, -1), 0, valDestPath); + m_textDestPath->SetHelpText(_("Enter the local path where you want the code be exported.")); wxButton* browse = - new wxButton (wnd, ID_BUTTON_BROWSE, wxT("..."), - wxDefaultPosition, wxSize(20, -1) ); + new wxButton(wnd, ID_BUTTON_BROWSE, wxT("..."), + wxDefaultPosition, wxSize(20, -1)); wxStaticBox* revisionBox = - new wxStaticBox (wnd, -1, _("Revision")); - wxTextValidator valRevision (wxFILTER_NUMERIC, &data.Revision); + new wxStaticBox(wnd, -1, _("Revision")); + wxTextValidator valRevision(wxFILTER_NUMERIC, &data.Revision); m_textRevision = - new wxTextCtrl (wnd, -1, wxEmptyString, wxDefaultPosition, - wxSize(50, -1), 0, valRevision); + new wxTextCtrl(wnd, -1, wxEmptyString, wxDefaultPosition, + wxSize(50, -1), 0, valRevision); m_textRevision->SetHelpText(_("If not using the latest version of the files, specify which revision to use here.")); - wxGenericValidator valLatest (&data.UseLatest); + wxGenericValidator valLatest(&data.UseLatest); m_checkUseLatest = - new wxCheckBox (wnd, ID_USE_LATEST, _("Use latest"), + new wxCheckBox(wnd, ID_USE_LATEST, _("Use latest"), wxDefaultPosition, wxDefaultSize, 0, valLatest); m_checkUseLatest->SetHelpText(_("Set this to get the latest version of the files in the repository.")); wxStaticBox* pegRevisionBox = - new wxStaticBox (wnd, -1, _("Peg Revision")); - wxTextValidator valPegRevision (wxFILTER_NUMERIC, &data.PegRevision); + new wxStaticBox(wnd, -1, _("Peg Revision")); + wxTextValidator valPegRevision(wxFILTER_NUMERIC, &data.PegRevision); m_textPegRevision = - new wxTextCtrl (wnd, -1, wxEmptyString, wxDefaultPosition, - wxSize(50, -1), 0, valPegRevision); + new wxTextCtrl(wnd, -1, wxEmptyString, wxDefaultPosition, + wxSize(50, -1), 0, valPegRevision); m_textPegRevision->SetHelpText(_("If the files were renamed or moved some time, specify which peg revision to use here.")); - wxGenericValidator valNotSpecified (&data.NotSpecified); + wxGenericValidator valNotSpecified(&data.NotSpecified); m_checkNotSpecified = - new wxCheckBox (wnd, ID_NOT_SPECIFIED, _("Not specified"), - wxDefaultPosition, wxDefaultSize, 0, valNotSpecified); + new wxCheckBox(wnd, ID_NOT_SPECIFIED, _("Not specified"), + wxDefaultPosition, wxDefaultSize, 0, valNotSpecified); m_checkNotSpecified->SetHelpText(_("Set this to use BASE/HEAD (current) peg revision of the files.")); wxCheckBox* recursive = - new wxCheckBox (wnd, -1, _("Recursive"), - wxDefaultPosition, wxDefaultSize, 0, - wxGenericValidator(&data.Recursive)); + new wxCheckBox(wnd, -1, _("Recursive"), + wxDefaultPosition, wxDefaultSize, 0, + wxGenericValidator(&data.Recursive)); recursive->SetHelpText(_("Set to get all subdirectories from the URL also.")); wxCheckBox* overwrite = - new wxCheckBox (wnd, -1, _("Overwrite"), - wxDefaultPosition, wxDefaultSize, 0, - wxGenericValidator(&data.Overwrite)); + new wxCheckBox(wnd, -1, _("Overwrite"), + wxDefaultPosition, wxDefaultSize, 0, + wxGenericValidator(&data.Overwrite)); overwrite->SetHelpText(_("Force to execute even if destination directory not empty, causes overwriting of files with the same names.")); wxCheckBox* ignoreExternals = - new wxCheckBox (wnd, -1, _("Ignore externals"), - wxDefaultPosition, wxDefaultSize, 0, - wxGenericValidator(&data.IgnoreExternals)); + new wxCheckBox(wnd, -1, _("Ignore externals"), + wxDefaultPosition, wxDefaultSize, 0, + wxGenericValidator(&data.IgnoreExternals)); ignoreExternals->SetHelpText(_("Set to ignore external definitions and the external working copies managed by them.")); - wxStaticText * labelEol = new wxStaticText ( + wxStaticText * labelEol = new wxStaticText( wnd, -1, _("EOL:"), wxDefaultPosition); wxString eol [] = @@ -137,53 +137,53 @@ struct ExportDlg::Data _("LF (Unix)"), _("CR (MacOS)") }; - m_comboNativeEol = new wxComboBox (wnd, ID_NATIVE_EOL, _("native"), - wxDefaultPosition, wxDefaultSize, 0, - eol, wxCB_DROPDOWN); - m_comboNativeEol->SetHelpText (_("Enter what kind of symbol(s) do you want as EOL (end of line) in exported files.")); + m_comboNativeEol = new wxComboBox(wnd, ID_NATIVE_EOL, _("native"), + wxDefaultPosition, wxDefaultSize, 0, + eol, wxCB_DROPDOWN); + m_comboNativeEol->SetHelpText(_("Enter what kind of symbol(s) do you want as EOL (end of line) in exported files.")); - m_buttonOk = new wxButton( wnd, wxID_OK, _("OK" )); - wxButton* cancel = new wxButton( wnd, wxID_CANCEL, _("Cancel")); + m_buttonOk = new wxButton(wnd, wxID_OK, _("OK")); + wxButton* cancel = new wxButton(wnd, wxID_CANCEL, _("Cancel")); // TODO: online help. Help button doesn't work yet, so commented out. // wxButton* help = new wxButton( wnd, wxID_HELP, _("Help")); // place controls // URL row wxStaticBoxSizer *urlSizer = - new wxStaticBoxSizer (urlBox, wxHORIZONTAL); - urlSizer->Add (m_comboSrcPath, 1, wxALL | wxEXPAND, 5); + new wxStaticBoxSizer(urlBox, wxHORIZONTAL); + urlSizer->Add(m_comboSrcPath, 1, wxALL | wxEXPAND, 5); // Destination row wxStaticBoxSizer *destSizer = - new wxStaticBoxSizer (destBox, wxHORIZONTAL); - destSizer->Add (m_textDestPath, 1, wxALL | wxEXPAND, 5); - destSizer->Add (browse, 0, wxALL, 5); + new wxStaticBoxSizer(destBox, wxHORIZONTAL); + destSizer->Add(m_textDestPath, 1, wxALL | wxEXPAND, 5); + destSizer->Add(browse, 0, wxALL, 5); // Revision row - wxBoxSizer *reSizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer *reSizer = new wxBoxSizer(wxHORIZONTAL); wxStaticBoxSizer *revisionSizer = - new wxStaticBoxSizer (revisionBox, wxHORIZONTAL); - revisionSizer->Add (m_textRevision, 1, wxALL | wxEXPAND, 5); - revisionSizer->Add (m_checkUseLatest, 0, - wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); - reSizer->Add (revisionSizer, 1, wxALL | wxEXPAND, 0); + new wxStaticBoxSizer(revisionBox, wxHORIZONTAL); + revisionSizer->Add(m_textRevision, 1, wxALL | wxEXPAND, 5); + revisionSizer->Add(m_checkUseLatest, 0, + wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); + reSizer->Add(revisionSizer, 1, wxALL | wxEXPAND, 0); - wxBoxSizer *preSizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer *preSizer = new wxBoxSizer(wxHORIZONTAL); // Peg revision row wxStaticBoxSizer *pegRevisionSizer = - new wxStaticBoxSizer (pegRevisionBox, wxHORIZONTAL); - pegRevisionSizer->Add (m_textPegRevision, 1, wxALL | wxEXPAND, 5); - pegRevisionSizer->Add (m_checkNotSpecified, 0, - wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); - preSizer->Add (pegRevisionSizer, 1, wxALL | wxEXPAND, 0); + new wxStaticBoxSizer(pegRevisionBox, wxHORIZONTAL); + pegRevisionSizer->Add(m_textPegRevision, 1, wxALL | wxEXPAND, 5); + pegRevisionSizer->Add(m_checkNotSpecified, 0, + wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); + preSizer->Add(pegRevisionSizer, 1, wxALL | wxEXPAND, 0); // the native eol combo - wxBoxSizer *nativeEolSizer = new wxBoxSizer (wxHORIZONTAL); - nativeEolSizer->Add (labelEol, 1, wxALL | wxEXPAND, 5); - nativeEolSizer->Add (m_comboNativeEol, 1, wxALL | wxEXPAND, 5); + wxBoxSizer *nativeEolSizer = new wxBoxSizer(wxHORIZONTAL); + nativeEolSizer->Add(labelEol, 1, wxALL | wxEXPAND, 5); + nativeEolSizer->Add(m_comboNativeEol, 1, wxALL | wxEXPAND, 5); // Button row - wxBoxSizer *buttonSizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); buttonSizer->Add(m_buttonOk, 0, wxALL, 10); buttonSizer->Add(cancel, 0, wxALL, 10); // Add explicit context-sensitive help button for non-MSW @@ -194,20 +194,20 @@ struct ExportDlg::Data #endif // Extras sizer - wxBoxSizer *extrasSizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer *extrasSizer = new wxBoxSizer(wxHORIZONTAL); extrasSizer->Add(recursive, 0, wxALL | wxCENTER, 5); extrasSizer->Add(overwrite, 0, wxALL | wxCENTER, 5); extrasSizer->Add(ignoreExternals, 0, wxALL | wxCENTER, 5); // Add all sizers to main sizer - wxBoxSizer *mainSizer = new wxBoxSizer (wxVERTICAL); - mainSizer->Add (urlSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (destSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (reSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (preSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (nativeEolSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (extrasSizer, 0, wxALL | wxCENTER, 5); - mainSizer->Add (buttonSizer, 0, wxALL | wxCENTER, 5); + wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(urlSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(destSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(reSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(preSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(nativeEolSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(extrasSizer, 0, wxALL | wxCENTER, 5); + mainSizer->Add(buttonSizer, 0, wxALL | wxCENTER, 5); wnd->SetAutoLayout(true); wnd->SetSizer(mainSizer); @@ -219,82 +219,82 @@ struct ExportDlg::Data void CheckControls() { - bool useLatest = m_checkUseLatest->IsChecked (); - bool notSpecified = m_checkNotSpecified->IsChecked (); + bool useLatest = m_checkUseLatest->IsChecked(); + bool notSpecified = m_checkNotSpecified->IsChecked(); - m_textRevision->Enable (!useLatest); - m_textPegRevision->Enable (!notSpecified); + m_textRevision->Enable(!useLatest); + m_textPegRevision->Enable(!notSpecified); bool ok = true; if (!useLatest) { - ok = CheckRevision (m_textRevision->GetValue ()); + ok = CheckRevision(m_textRevision->GetValue()); } if (!notSpecified) { - ok = CheckRevision (m_textPegRevision->GetValue ()); + ok = CheckRevision(m_textPegRevision->GetValue()); } - if (m_textDestPath->GetValue ().Length () <= 0) + if (m_textDestPath->GetValue().Length() <= 0) { ok = false; } - if (m_comboSrcPath->GetValue ().Length () <= 0) + if (m_comboSrcPath->GetValue().Length() <= 0) { ok = false; } - if (m_comboNativeEol->GetValue ().Length () <= 0) + if (m_comboNativeEol->GetValue().Length() <= 0) { ok = false; } else { - wxString textEol = m_comboNativeEol->GetValue (); + wxString textEol = m_comboNativeEol->GetValue(); if (textEol == wxT("CRLF (Windows)")) - data.Eol = "CRLF"; + data.Eol = "CRLF"; else if (textEol == wxT("LF (Unix)")) - data.Eol = "LF"; + data.Eol = "LF"; else if (textEol == wxT("CR (MacOS)")) - data.Eol = "CR"; + data.Eol = "CR"; else - data.Eol = NULL; + data.Eol = NULL; } - m_buttonOk->Enable (ok); + m_buttonOk->Enable(ok); if (ok) { - m_buttonOk->SetDefault (); + m_buttonOk->SetDefault(); } } }; -BEGIN_EVENT_TABLE (ExportDlg, wxDialog) - EVT_BUTTON (ID_BUTTON_BROWSE, ExportDlg::OnBrowse) - EVT_CHECKBOX (ID_USE_LATEST, ExportDlg::OnUseLatest) - EVT_CHECKBOX (ID_NOT_SPECIFIED, ExportDlg::OnNotSpecified) - EVT_COMBOBOX (ID_NATIVE_EOL, ExportDlg::OnNativeEol) - EVT_TEXT (-1, ExportDlg::OnText) -// EVT_BUTTON (wxID_HELP, ExportDlg::OnHelp) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(ExportDlg, wxDialog) + EVT_BUTTON(ID_BUTTON_BROWSE, ExportDlg::OnBrowse) + EVT_CHECKBOX(ID_USE_LATEST, ExportDlg::OnUseLatest) + EVT_CHECKBOX(ID_NOT_SPECIFIED, ExportDlg::OnNotSpecified) + EVT_COMBOBOX(ID_NATIVE_EOL, ExportDlg::OnNativeEol) + EVT_TEXT(-1, ExportDlg::OnText) + // EVT_BUTTON (wxID_HELP, ExportDlg::OnHelp) +END_EVENT_TABLE() -ExportDlg::ExportDlg (wxWindow * parent, const svn::Path & selectedUrl) +ExportDlg::ExportDlg(wxWindow * parent, const svn::Path & selectedUrl) { // Add the context-sensitive help button on the caption for MSW #ifdef __WXMSW__ - SetExtraStyle (wxDIALOG_EX_CONTEXTHELP); + SetExtraStyle(wxDIALOG_EX_CONTEXTHELP); #endif - Create (parent, -1, _("Export"), wxDefaultPosition, - wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); + Create(parent, -1, _("Export"), wxDefaultPosition, + wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); - m = new Data (this); + m = new Data(this); CentreOnParent(); - m->data.SrcPath = Utf8ToLocal (selectedUrl.c_str ()); + m->data.SrcPath = Utf8ToLocal(selectedUrl.c_str()); } -ExportDlg::~ExportDlg () +ExportDlg::~ExportDlg() { delete m; } @@ -303,17 +303,17 @@ ExportDlg::~ExportDlg () * Brings up a directory dialog defaulted to the user's home directory. */ void -ExportDlg::OnBrowse (wxCommandEvent & event) +ExportDlg::OnBrowse(wxCommandEvent & event) { // Transfer data from controls into m_pData: TransferDataFromWindow(); - wxDirDialog dialog (this, - _("Select a destination directory"), - wxGetHomeDir(), wxDD_NEW_DIR_BUTTON); + wxDirDialog dialog(this, + _("Select a destination directory"), + wxGetHomeDir(), wxDD_NEW_DIR_BUTTON); - if (dialog.ShowModal () == wxID_OK) + if (dialog.ShowModal() == wxID_OK) { - m->data.DestPath = dialog.GetPath (); + m->data.DestPath = dialog.GetPath(); // Transfer data from m_pData back into controls: TransferDataToWindow(); } @@ -333,31 +333,31 @@ ExportDlg::OnUseLatest(wxCommandEvent &) } void -ExportDlg::OnNotSpecified (wxCommandEvent &) +ExportDlg::OnNotSpecified(wxCommandEvent &) { m->CheckControls(); } void -ExportDlg::OnNativeEol (wxCommandEvent &) +ExportDlg::OnNativeEol(wxCommandEvent &) { m->CheckControls(); } const ExportData & -ExportDlg::GetData () const +ExportDlg::GetData() const { return m->data; } void -ExportDlg::OnText (wxCommandEvent &) +ExportDlg::OnText(wxCommandEvent &) { - m->CheckControls (); + m->CheckControls(); } void -ExportDlg::OnHelp (wxCommandEvent & event) +ExportDlg::OnHelp(wxCommandEvent & event) { // @todo Has to be re-integrated for Online Help // ::wxGetApp ().GetHelpController().Display(wxT("Export dialog")); diff --git a/src/export_dlg.hpp b/src/export_dlg.hpp index 1fbf7948..2f169bb6 100644 --- a/src/export_dlg.hpp +++ b/src/export_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -49,18 +49,18 @@ class ExportDlg : public wxDialog * @param parent window * @param selectedUrl Use this value to pre-fill the URL */ - ExportDlg (wxWindow *parent, const svn::Path & selectedUrl); + ExportDlg(wxWindow *parent, const svn::Path & selectedUrl); /** * Destructor */ - virtual ~ExportDlg (); + virtual ~ExportDlg(); /** * return the reference to @a ExportData */ const ExportData & - GetData () const; + GetData() const; private: /** hide implementation details */ @@ -68,27 +68,27 @@ class ExportDlg : public wxDialog Data *m; void - OnBrowse (wxCommandEvent & event); + OnBrowse(wxCommandEvent & event); void - OnText (wxCommandEvent & event); + OnText(wxCommandEvent & event); void - OnHelp (wxCommandEvent & event); + OnHelp(wxCommandEvent & event); void - OnUseLatest (wxCommandEvent & event); + OnUseLatest(wxCommandEvent & event); void - OnNotSpecified (wxCommandEvent & event); + OnNotSpecified(wxCommandEvent & event); void - OnNativeEol (wxCommandEvent & event); + OnNativeEol(wxCommandEvent & event); void - InitDialog (); + InitDialog(); - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/external_program_action.cpp b/src/external_program_action.cpp index 190d0db4..d018e244 100644 --- a/src/external_program_action.cpp +++ b/src/external_program_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -40,37 +40,37 @@ #include "utils.hpp" #include "verblist.hpp" -ExternalProgramAction::ExternalProgramAction ( - wxWindow * parent, long verb_id, bool treat_as_folder) - : Action (parent, _("Execute"), UPDATE_LATER), - m_verb_id (verb_id), - m_treat_as_folder (treat_as_folder), - m_parent (parent) +ExternalProgramAction::ExternalProgramAction( + wxWindow * parent, long verb_id, bool treat_as_folder) + : Action(parent, _("Execute"), UPDATE_LATER), + m_verb_id(verb_id), + m_treat_as_folder(treat_as_folder), + m_parent(parent) { } bool -ExternalProgramAction::Prepare () +ExternalProgramAction::Prepare() { - return Action::Prepare (); + return Action::Prepare(); } bool -ExternalProgramAction::Perform () +ExternalProgramAction::Perform() { VerbList verb_list; // wxBusyCursor busy_cursor; // The actual target - svn::Path path = GetTarget (); - if (path.isUrl ()) + svn::Path path = GetTarget(); + if (path.isUrl()) path = GetPathAsTempFile(path); - - wxString target_str = Utf8ToLocal (path.c_str ()); + + wxString target_str = Utf8ToLocal(path.c_str()); wxFileName target = target_str; // The target we'll pass to the external program - wxString target_document = target.GetFullPath (); + wxString target_document = target.GetFullPath(); Preferences prefs; if (m_treat_as_folder) @@ -82,7 +82,7 @@ ExternalProgramAction::Perform () } // Get verbs from the OS - verb_list.InitFromDocument (target_document, m_treat_as_folder); + verb_list.InitFromDocument(target_document, m_treat_as_folder); // An explicit verb was chose that is not available if ((m_verb_id >= 0) && ((size_t)m_verb_id > verb_list.GetCount())) @@ -93,54 +93,54 @@ ExternalProgramAction::Perform () if (m_treat_as_folder) { - if (verb_list.GetCount () && !((m_verb_id == -1) - && prefs.explorerAlways)) + if (verb_list.GetCount() && !((m_verb_id == -1) + && prefs.explorerAlways)) { - verb_list.Launch ((m_verb_id == -1 ? 0 : m_verb_id)); + verb_list.Launch((m_verb_id == -1 ? 0 : m_verb_id)); } else { - wxString args (prefs.explorerArgs); - TrimString (args); + wxString args(prefs.explorerArgs); + TrimString(args); - if (args.Length () == 0) + if (args.Length() == 0) args = wxT("\"") + target_document + wxT("\""); else - args.Replace (wxT("%1"), target_document, true); - - wxString cmd (prefs.explorer + wxT(" ") + args); + args.Replace(wxT("%1"), target_document, true); + + wxString cmd(prefs.explorer + wxT(" ") + args); wxString msg; - msg.Printf (_("Execute file explorer: %s"), cmd.c_str ()); - Trace (msg); + msg.Printf(_("Execute file explorer: %s"), cmd.c_str()); + Trace(msg); - ActionEvent::Post (m_parent, TOKEN_CMD, cmd); + ActionEvent::Post(m_parent, TOKEN_CMD, cmd); } } else { - if (verb_list.GetCount () && !((m_verb_id == -1) - && prefs.editorAlways)) + if (verb_list.GetCount() && !((m_verb_id == -1) + && prefs.editorAlways)) { - verb_list.Launch ((m_verb_id == -1 ? 0 : m_verb_id)); + verb_list.Launch((m_verb_id == -1 ? 0 : m_verb_id)); } else { - wxString args (prefs.editorArgs); - TrimString (args); + wxString args(prefs.editorArgs); + TrimString(args); - if (args.Length () == 0) + if (args.Length() == 0) args = wxT("\"") + target_document + wxT("\""); else - args.Replace (wxT("%1"), target_document, true); - - wxString cmd (prefs.editor + wxT(" ") + args); + args.Replace(wxT("%1"), target_document, true); + + wxString cmd(prefs.editor + wxT(" ") + args); wxString msg; - msg.Printf (_("Execute editor: %s"), cmd.c_str ()); - Trace (msg); + msg.Printf(_("Execute editor: %s"), cmd.c_str()); + Trace(msg); - ActionEvent::Post (m_parent, TOKEN_CMD, cmd); + ActionEvent::Post(m_parent, TOKEN_CMD, cmd); } } @@ -148,15 +148,15 @@ ExternalProgramAction::Perform () } bool -ExternalProgramAction::CheckStatusSel (const svn::StatusSel & statusSel) +ExternalProgramAction::CheckStatusSel(const svn::StatusSel & statusSel) { // works with all kinds of files and dirs, // but only ONE is allowed - if (1 != statusSel.size ()) + if (1 != statusSel.size()) return false; // directories are allowed only local - if (statusSel.hasUrl () && statusSel.hasDirs ()) + if (statusSel.hasUrl() && statusSel.hasDirs()) return false; return true; diff --git a/src/external_program_action.hpp b/src/external_program_action.hpp index 71946fd5..69865eef 100644 --- a/src/external_program_action.hpp +++ b/src/external_program_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -47,17 +47,17 @@ class ExternalProgramAction:public Action * If false, the target is assumed to be a file, and * the verb should be explicit. */ - ExternalProgramAction (wxWindow * parent, long verb_id, - bool treat_as_folder); + ExternalProgramAction(wxWindow * parent, long verb_id, + bool treat_as_folder); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: long m_verb_id; @@ -65,7 +65,7 @@ class ExternalProgramAction:public Action wxWindow * m_parent; }; -#endif +#endif /* ----------------------------------------------------------------- * local variables: * eval: (load-file "../rapidsvn-dev.el") diff --git a/src/file_info.cpp b/src/file_info.cpp index 73bce4b2..ef2714a6 100644 --- a/src/file_info.cpp +++ b/src/file_info.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -43,20 +43,20 @@ #include "utils.hpp" static void -info_print_time (apr_time_t atime, const wxChar * desc, wxString & str) +info_print_time(apr_time_t atime, const wxChar * desc, wxString & str) { apr_time_exp_t extime; apr_status_t apr_err; /* if this returns an error, just don't print anything out */ - apr_err = apr_time_exp_tz (&extime, atime, 0); + apr_err = apr_time_exp_tz(&extime, atime, 0); if (!apr_err) - str.Printf (wxT("%s: %04lu-%02lu-%02lu %02lu:%02lu GMT"), desc, - (unsigned long) (extime.tm_year + 1900), - (unsigned long) (extime.tm_mon + 1), - (unsigned long) (extime.tm_mday), - (unsigned long) (extime.tm_hour), - (unsigned long) (extime.tm_min)); + str.Printf(wxT("%s: %04lu-%02lu-%02lu %02lu:%02lu GMT"), desc, + (unsigned long)(extime.tm_year + 1900), + (unsigned long)(extime.tm_mon + 1), + (unsigned long)(extime.tm_mday), + (unsigned long)(extime.tm_hour), + (unsigned long)(extime.tm_min)); } struct FileInfo::Data @@ -66,242 +66,242 @@ struct FileInfo::Data wxString info; bool withUpdate; - Data (svn::Context * ctx, bool update) - : context (ctx), withUpdate (update) + Data(svn::Context * ctx, bool update) + : context(ctx), withUpdate(update) { } void - addLine (const wxString & line = wxEmptyString) + addLine(const wxString & line = wxEmptyString) { info += line; info += wxT("\n"); } void - addInfoForStatus (const svn::Status & status) + addInfoForStatus(const svn::Status & status) { - const svn::Entry entry = status.entry (); + const svn::Entry entry = status.entry(); wxString str, tmp; - if (!entry.isValid ()) + if (!entry.isValid()) { - addLine (_("Not versioned")); + addLine(_("Not versioned")); return; } svn_boolean_t text_conflict = FALSE; svn_boolean_t props_conflict = FALSE; - str.Printf (_("Name: %s"), Utf8ToLocal (svn::Url::unescape (entry.name ())).c_str ()); - addLine (str); + str.Printf(_("Name: %s"), Utf8ToLocal(svn::Url::unescape(entry.name())).c_str()); + addLine(str); - str.Printf (_("URL: %s"), Utf8ToLocal (svn::Url::unescape (entry.url ())).c_str ()); - addLine (str); + str.Printf(_("URL: %s"), Utf8ToLocal(svn::Url::unescape(entry.url())).c_str()); + addLine(str); - if (entry.repos ()) - tmp = Utf8ToLocal (svn::Url::unescape (entry.repos ())); + if (entry.repos()) + tmp = Utf8ToLocal(svn::Url::unescape(entry.repos())); else tmp = _(""); - str.Printf (_("Repository: %s"), tmp.c_str ()); - addLine (str); + str.Printf(_("Repository: %s"), tmp.c_str()); + addLine(str); - if (entry.uuid ()) { - tmp = Utf8ToLocal (entry.uuid ()); + if (entry.uuid()) { + tmp = Utf8ToLocal(entry.uuid()); } else { tmp = _(""); } - str.Printf (_("Repository UUID: %s"), tmp.c_str ()); - addLine (str); + str.Printf(_("Repository UUID: %s"), tmp.c_str()); + addLine(str); - str.Printf (_("Revision: %ld"), entry.revision ()); - addLine (str); + str.Printf(_("Revision: %ld"), entry.revision()); + addLine(str); wxString fmt = _("Node Kind: %s"); - switch (entry.kind ()) + switch (entry.kind()) { case svn_node_file: - str.Printf (fmt, _("file")); + str.Printf(fmt, _("file")); break; case svn_node_dir: - str.Printf (fmt, _("directory")); + str.Printf(fmt, _("directory")); // SVN_ERR (svn_wc_conflicted_p (&text_conflict, &props_conflict, // path.c_str (), entry, pool)); break; case svn_node_none: - str.Printf (fmt, _("none")); + str.Printf(fmt, _("none")); break; case svn_node_unknown: default: - str.Printf (fmt, _("unknown")); + str.Printf(fmt, _("unknown")); break; } - addLine (str); + addLine(str); fmt = _("Schedule: %s"); - switch (entry.schedule ()) + switch (entry.schedule()) { case svn_wc_schedule_normal: - str.Printf (fmt, _("normal")); + str.Printf(fmt, _("normal")); break; case svn_wc_schedule_add: - str.Printf (fmt, _("add")); + str.Printf(fmt, _("add")); break; case svn_wc_schedule_delete: - str.Printf (fmt, _("delete")); + str.Printf(fmt, _("delete")); break; case svn_wc_schedule_replace: - str.Printf (fmt, _("replace")); + str.Printf(fmt, _("replace")); break; default: - str.Printf (fmt, _("unknown")); + str.Printf(fmt, _("unknown")); break; } - if (entry.isCopied ()) + if (entry.isCopied()) { - tmp = Utf8ToLocal (entry.copyfromUrl ()); - str.Printf (_("Copied From URL: %s"), tmp.c_str ()); - addLine (str); + tmp = Utf8ToLocal(entry.copyfromUrl()); + str.Printf(_("Copied From URL: %s"), tmp.c_str()); + addLine(str); - str.Printf (_("Copied From Rev: %ld"), entry.copyfromRev ()); - addLine (str); + str.Printf(_("Copied From Rev: %ld"), entry.copyfromRev()); + addLine(str); } - tmp = Utf8ToLocal (entry.cmtAuthor ()); - str.Printf (_("Last Changed Author: %s"), tmp.c_str ()); - addLine (str); + tmp = Utf8ToLocal(entry.cmtAuthor()); + str.Printf(_("Last Changed Author: %s"), tmp.c_str()); + addLine(str); - str.Printf (_("Last Changed Rev: %ld"), entry.cmtRev ()); - addLine (str); + str.Printf(_("Last Changed Rev: %ld"), entry.cmtRev()); + addLine(str); - info_print_time (entry.cmtDate (), _("Last Changed Date"), str); - addLine (str); + info_print_time(entry.cmtDate(), _("Last Changed Date"), str); + addLine(str); - info_print_time (entry.textTime (), _("Text Last Updated"), str); - addLine (str); + info_print_time(entry.textTime(), _("Text Last Updated"), str); + addLine(str); - info_print_time (entry.propTime (), _("Properties Last Updated"), str); - addLine (str); + info_print_time(entry.propTime(), _("Properties Last Updated"), str); + addLine(str); - if (entry.checksum ()) { - tmp = Utf8ToLocal (entry.checksum ()); + if (entry.checksum()) { + tmp = Utf8ToLocal(entry.checksum()); } else { tmp = _(""); } - str.Printf (_("Checksum: %s"), tmp.c_str ()); - addLine (str); + str.Printf(_("Checksum: %s"), tmp.c_str()); + addLine(str); if (text_conflict) { - tmp = Utf8ToLocal (entry.conflictOld ()); - str.Printf (_("Conflict BASE File: %s"), - tmp.c_str ()); - addLine (str); - - tmp = Utf8ToLocal (entry.conflictWrk ()); - str.Printf (_("Conflict Working File: %s"), - tmp.c_str ()); - addLine (str); - - tmp = Utf8ToLocal (entry.conflictNew ()); - str.Printf (_("Conflict HEAD File: %s"), - tmp.c_str ()); - addLine (str); + tmp = Utf8ToLocal(entry.conflictOld()); + str.Printf(_("Conflict BASE File: %s"), + tmp.c_str()); + addLine(str); + + tmp = Utf8ToLocal(entry.conflictWrk()); + str.Printf(_("Conflict Working File: %s"), + tmp.c_str()); + addLine(str); + + tmp = Utf8ToLocal(entry.conflictNew()); + str.Printf(_("Conflict HEAD File: %s"), + tmp.c_str()); + addLine(str); } if (props_conflict) { - tmp = Utf8ToLocal (entry.prejfile ()); - str.Printf (_("Conflict Properties File: %s"), - tmp.c_str ()); - addLine (str); + tmp = Utf8ToLocal(entry.prejfile()); + str.Printf(_("Conflict Properties File: %s"), + tmp.c_str()); + addLine(str); } - if (status.isLocked ()) + if (status.isLocked()) { - tmp = Utf8ToLocal (status.lockToken ()); - str.Printf (_("Lock Token: %s"), - tmp.c_str ()); - addLine (str); - - tmp = Utf8ToLocal (status.lockOwner ()); - str.Printf (_("Lock Owner: %s"), - tmp.c_str ()); - addLine (str); - - tmp = Utf8ToLocal (status.lockComment ()); - str.Printf (_("Lock Comment:\n%s"), - tmp.c_str ()); - addLine (str); - - info_print_time (status.lockCreationDate (), _("Lock Creation Date"), str); + tmp = Utf8ToLocal(status.lockToken()); + str.Printf(_("Lock Token: %s"), + tmp.c_str()); + addLine(str); + + tmp = Utf8ToLocal(status.lockOwner()); + str.Printf(_("Lock Owner: %s"), + tmp.c_str()); + addLine(str); + + tmp = Utf8ToLocal(status.lockComment()); + str.Printf(_("Lock Comment:\n%s"), + tmp.c_str()); + addLine(str); + + info_print_time(status.lockCreationDate(), _("Lock Creation Date"), str); } } void - createInfoForPath (svn::Client & client, const char * path) + createInfoForPath(svn::Client & client, const char * path) { try { - svn::StatusEntries ent = client.status (path, false, true, withUpdate); + svn::StatusEntries ent = client.status(path, false, true, withUpdate); svn::StatusEntries::const_iterator it; - for (it=ent.begin (); it!=ent.end (); it++) + for (it=ent.begin(); it!=ent.end(); it++) { - svn::Status status (*it); + svn::Status status(*it); - addLine (Utf8ToLocal (status.path ())); - addInfoForStatus (status); - addLine (); + addLine(Utf8ToLocal(status.path())); + addInfoForStatus(status); + addLine(); } } catch (svn::Exception & e) { - addLine (_("Error retrieving status:")); - addLine (Utf8ToLocal (e.message ())); + addLine(_("Error retrieving status:")); + addLine(Utf8ToLocal(e.message())); } } }; -FileInfo::FileInfo (svn::Context * context, bool withUpdate) +FileInfo::FileInfo(svn::Context * context, bool withUpdate) { - m = new Data (context, withUpdate); + m = new Data(context, withUpdate); } -FileInfo::~FileInfo () +FileInfo::~FileInfo() { delete m; } void -FileInfo::addPath (const char * path) +FileInfo::addPath(const char * path) { - m->targets.push_back (path); + m->targets.push_back(path); } const wxString & -FileInfo::info () const +FileInfo::info() const { - m->info.Clear (); - svn::Client client (m->context); + m->info.Clear(); + svn::Client client(m->context); std::vector::const_iterator it; - for (it = m->targets.begin (); it != m->targets.end (); it++) + for (it = m->targets.begin(); it != m->targets.end(); it++) { svn::Path path = *it; - m->createInfoForPath (client, path.unescape ().c_str ()); - m->addLine (); + m->createInfoForPath(client, path.unescape().c_str()); + m->addLine(); } return m->info; diff --git a/src/file_info.hpp b/src/file_info.hpp index dbe5690b..5c97562b 100644 --- a/src/file_info.hpp +++ b/src/file_info.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -38,12 +38,12 @@ class FileInfo * * @param context context to use */ - FileInfo (svn::Context * context, bool withUpdate = false); + FileInfo(svn::Context * context, bool withUpdate = false); /** * destructor */ - virtual ~FileInfo (); + virtual ~FileInfo(); /** * adds a path to the list of paths that are to be examined @@ -51,7 +51,7 @@ class FileInfo * @param path absolute path to add */ void - addPath (const char * path); + addPath(const char * path); /** * get an info string that contains informations about @@ -60,7 +60,7 @@ class FileInfo * @return informational string */ const wxString & - info () const; + info() const; private: // hide implementation details diff --git a/src/filelist_ctrl.cpp b/src/filelist_ctrl.cpp index dee032d9..8196834c 100644 --- a/src/filelist_ctrl.cpp +++ b/src/filelist_ctrl.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -27,7 +27,7 @@ // stl #include #include "svncpp/map_wrapper.hpp" -#include +#include #include // wxWidgets @@ -124,7 +124,7 @@ static const wxChar ConfigShowIgnored[] = wxT("/FileListCtrl/ShowIgnored"); * @retval false is invalid status */ static bool -IsDir (const svn::Status * status) +IsDir(const svn::Status * status) { // invalid entry @@ -134,19 +134,19 @@ IsDir (const svn::Status * status) } // versioned resource? - const svn::Entry & entry = status->entry (); + const svn::Entry & entry = status->entry(); - if (entry.isValid ()) + if (entry.isValid()) { - return entry.kind () == svn_node_dir; + return entry.kind() == svn_node_dir; } // unversioned. - return wxDirExists (Utf8ToLocal (status->path ())); + return wxDirExists(Utf8ToLocal(status->path())); } static const int -GetDefaultWidth (int col) +GetDefaultWidth(int col) { int width; switch (col) @@ -189,7 +189,7 @@ GetDefaultWidth (int col) * @retval -1 status1 < status2 */ static int -Compare (svn_wc_status_kind status1, svn_wc_status_kind status2, bool newer1, bool newer2) +Compare(svn_wc_status_kind status1, svn_wc_status_kind status2, bool newer1, bool newer2) { if (newer1 && status1 == svn_wc_status_normal) { @@ -249,40 +249,40 @@ Compare (svn_wc_status_kind status1, svn_wc_status_kind status2, bool newer1, bo * @return < -> -1 / = -> 0 / > -> 1 */ static int -ComparePaths (const char * p1, const char * p2) +ComparePaths(const char * p1, const char * p2) { - wxString wxp1 (Utf8ToLocal (p1)); - wxString wxp2 (Utf8ToLocal (p2)); + wxString wxp1(Utf8ToLocal(p1)); + wxString wxp2(Utf8ToLocal(p2)); - wxFileName fn1 (wxp1); - wxFileName fn2 (wxp2); + wxFileName fn1(wxp1); + wxFileName fn2(wxp2); - wxString path1 = fn1.GetPath (); - wxString path2 = fn2.GetPath (); + wxString path1 = fn1.GetPath(); + wxString path2 = fn2.GetPath(); int res = 0; // Is p2 a subdir or entry of p1? - if (path1.CmpNoCase (wxp2) == 0) + if (path1.CmpNoCase(wxp2) == 0) { return -1; } // Is p1 a subdir or entry of p2? - if (path2.CmpNoCase (wxp1) == 0) + if (path2.CmpNoCase(wxp1) == 0) { return 1; } // first compare path component - res = path1.CmpNoCase (path2); + res = path1.CmpNoCase(path2); if (res == 0) { - wxString file1 = fn1.GetName (); - wxString file2 = fn2.GetName (); + wxString file1 = fn1.GetName(); + wxString file2 = fn2.GetName(); - res = file1.CmpNoCase (file2); + res = file1.CmpNoCase(file2); } return res; @@ -300,7 +300,7 @@ ComparePaths (const char * p1, const char * p2) * @retval -1 rev1 < rev2 */ static int -Compare (const apr_time_t rev1, const apr_time_t rev2) +Compare(const apr_time_t rev1, const apr_time_t rev2) { if (rev1 == rev2) { @@ -317,15 +317,15 @@ Compare (const apr_time_t rev1, const apr_time_t rev2) * @return < -> -1 / = -> 0 / > -> 1 */ static int -Compare (const char * s1, const char * s2) +Compare(const char * s1, const char * s2) { const char * sv1 = s1 == 0 ? "" : s1; const char * sv2 = s2 == 0 ? "" : s2; - wxString wx1 (Utf8ToLocal (sv1)); - wxString wx2 (Utf8ToLocal (sv2)); + wxString wx1(Utf8ToLocal(sv1)); + wxString wx2(Utf8ToLocal(sv2)); - return wx1.CmpNoCase (wx2); + return wx1.CmpNoCase(wx2); } /** @@ -337,104 +337,104 @@ Compare (const char * s1, const char * s2) * @return -1 */ static int -CompareColumn (svn::Status * ps1, - svn::Status * ps2, - int column) +CompareColumn(svn::Status * ps1, + svn::Status * ps2, + int column) { int res = 0; - svn::Entry e1 (ps1->entry ()); - svn::Entry e2 (ps2->entry ()); + svn::Entry e1(ps1->entry()); + svn::Entry e2(ps2->entry()); bool newer1 = - (ps1->reposTextStatus () == svn_wc_status_modified) || - (ps1->reposPropStatus () == svn_wc_status_modified); + (ps1->reposTextStatus() == svn_wc_status_modified) || + (ps1->reposPropStatus() == svn_wc_status_modified); bool newer2 = - (ps2->reposTextStatus () == svn_wc_status_modified) || - (ps2->reposPropStatus () == svn_wc_status_modified); + (ps2->reposTextStatus() == svn_wc_status_modified) || + (ps2->reposPropStatus() == svn_wc_status_modified); - svn::Path path1 (ps1->path ()); - svn::Path path2 (ps2->path ()); + svn::Path path1(ps1->path()); + svn::Path path2(ps2->path()); switch (column) { case FileListCtrl::COL_NAME: - res = Compare (path1.basename ().c_str (), path2.basename ().c_str ()); + res = Compare(path1.basename().c_str(), path2.basename().c_str()); break; case FileListCtrl::COL_PATH: - res = ComparePaths (path1.c_str (), path2.c_str ()); + res = ComparePaths(path1.c_str(), path2.c_str()); break; case FileListCtrl::COL_REV: - res = Compare (e1.revision (), e2.revision ()); + res = Compare(e1.revision(), e2.revision()); break; case FileListCtrl::COL_CMT_REV: - res = Compare (e1.cmtRev (), e2.cmtRev ()); + res = Compare(e1.cmtRev(), e2.cmtRev()); break; case FileListCtrl::COL_AUTHOR: - res = Compare (e1.cmtAuthor (), e2.cmtAuthor ()); + res = Compare(e1.cmtAuthor(), e2.cmtAuthor()); break; case FileListCtrl::COL_TEXT_STATUS: - res = Compare (ps1->textStatus (), ps2->textStatus (), newer1, newer2); + res = Compare(ps1->textStatus(), ps2->textStatus(), newer1, newer2); break; case FileListCtrl::COL_PROP_STATUS: - res = Compare (ps1->propStatus (), ps2->propStatus (), newer1, newer2); + res = Compare(ps1->propStatus(), ps2->propStatus(), newer1, newer2); break; case FileListCtrl::COL_EXTENSION: - res = wxFileName(Utf8ToLocal (ps1->path())).GetExt().CmpNoCase (wxFileName(Utf8ToLocal (ps2->path())).GetExt()); + res = wxFileName(Utf8ToLocal(ps1->path())).GetExt().CmpNoCase(wxFileName(Utf8ToLocal(ps2->path())).GetExt()); break; case FileListCtrl::COL_CMT_DATE: - res = Compare (e1.cmtDate (), e2.cmtDate ()); + res = Compare(e1.cmtDate(), e2.cmtDate()); break; case FileListCtrl::COL_TEXT_TIME: - res = Compare (e1.textTime (), e2.textTime ()); + res = Compare(e1.textTime(), e2.textTime()); break; case FileListCtrl::COL_PROP_TIME: - res = Compare (e1.propTime (), e2.propTime ()); + res = Compare(e1.propTime(), e2.propTime()); break; case FileListCtrl::COL_CHECKSUM: - res = Compare (e1.checksum (), e2.checksum ()); + res = Compare(e1.checksum(), e2.checksum()); break; case FileListCtrl::COL_URL: - res = Compare (e1.url (), e2.url ()); + res = Compare(e1.url(), e2.url()); break; case FileListCtrl::COL_REPOS: - res = Compare (e1.url (), e2.url ()); + res = Compare(e1.url(), e2.url()); break; case FileListCtrl::COL_UUID: - res = Compare (e1.uuid (), e2.uuid ()); + res = Compare(e1.uuid(), e2.uuid()); break; case FileListCtrl::COL_SCHEDULE: - res = Compare (e1.schedule (), e2.schedule ()); + res = Compare(e1.schedule(), e2.schedule()); break; case FileListCtrl::COL_COPIED: - res = Compare (e1.isCopied (), e2.isCopied ()); + res = Compare(e1.isCopied(), e2.isCopied()); break; case FileListCtrl::COL_CONFLICT_OLD: - res = Compare (e1.conflictOld (), e2.conflictOld ()); + res = Compare(e1.conflictOld(), e2.conflictOld()); break; case FileListCtrl::COL_CONFLICT_NEW: - res = Compare (e1.conflictNew (), e2.conflictNew ()); + res = Compare(e1.conflictNew(), e2.conflictNew()); break; case FileListCtrl::COL_CONFLICT_WRK: - res = Compare (e1.conflictWrk (), e2.conflictWrk ()); + res = Compare(e1.conflictWrk(), e2.conflictWrk()); break; default: @@ -458,21 +458,21 @@ CompareColumn (svn::Status * ps1, * switch statements... */ static int -CompareItems (svn::Status * ps1, svn::Status * ps2, - int SortColumn, bool SortAscending, - bool IncludePath, size_t RootPathLength) +CompareItems(svn::Status * ps1, svn::Status * ps2, + int SortColumn, bool SortAscending, + bool IncludePath, size_t RootPathLength) { int res = 0; // Directories always precede files AND // Current working directory '.' always first - if (IsDir (ps1) && - (!IsDir (ps2) || (Utf8ToLocal (ps1->path ()).length () <= RootPathLength))) + if (IsDir(ps1) && + (!IsDir(ps2) || (Utf8ToLocal(ps1->path()).length() <= RootPathLength))) { res = -1; } - else if (IsDir (ps2) && - (!IsDir (ps1) || (Utf8ToLocal (ps2->path ()).length () <= RootPathLength))) + else if (IsDir(ps2) && + (!IsDir(ps1) || (Utf8ToLocal(ps2->path()).length() <= RootPathLength))) { res = 1; } @@ -483,36 +483,36 @@ CompareItems (svn::Status * ps1, svn::Status * ps2, switch (SortColumn) { case FileListCtrl::COL_NAME: - res = CompareColumn (ps1, ps2, FileListCtrl::COL_NAME); + res = CompareColumn(ps1, ps2, FileListCtrl::COL_NAME); if (res == 0) { - res = CompareColumn (ps1, ps2, FileListCtrl::COL_PATH); + res = CompareColumn(ps1, ps2, FileListCtrl::COL_PATH); } break; case FileListCtrl::COL_PATH: - res = CompareColumn (ps1, ps2, FileListCtrl::COL_PATH); + res = CompareColumn(ps1, ps2, FileListCtrl::COL_PATH); if (res == 0) { - res = CompareColumn (ps1, ps2, FileListCtrl::COL_NAME); + res = CompareColumn(ps1, ps2, FileListCtrl::COL_NAME); } break; default: - res = CompareColumn (ps1, ps2, SortColumn); + res = CompareColumn(ps1, ps2, SortColumn); // if IncludePath is true (Use full path in sorting), sort by full name // (path first, then name). // Otherwise, sort by name. if (res == 0) { - res = CompareColumn (ps1, ps2, (IncludePath ? FileListCtrl::COL_PATH : - FileListCtrl::COL_NAME)); + res = CompareColumn(ps1, ps2, (IncludePath ? FileListCtrl::COL_PATH : + FileListCtrl::COL_NAME)); } if (res == 0) { - res = CompareColumn (ps1, ps2, (IncludePath ? FileListCtrl::COL_NAME : - FileListCtrl::COL_PATH)); + res = CompareColumn(ps1, ps2, (IncludePath ? FileListCtrl::COL_NAME : + FileListCtrl::COL_PATH)); } break; } @@ -545,7 +545,7 @@ enum }; /** - * structure that maps a status entry to an + * structure that maps a status entry to an * according icon. */ struct MapItem @@ -554,13 +554,13 @@ struct MapItem const unsigned char * data; size_t len; - MapItem (int status_, const unsigned char *data_, size_t len_) - : status (status_), data (data_), len (len_) + MapItem(int status_, const unsigned char *data_, size_t len_) + : status(status_), data(data_), len(len_) { } }; -#define MAP_ITEM(status,data) MapItem(status, data, sizeof(data)) +#define MAP_ITEM(status,data) MapItem(status, data, sizeof(data)) /** array of icons and corresponding status */ static const MapItem MAP_ICON_ARRAY [] = @@ -589,8 +589,8 @@ static const MapItem MAP_ICON_ARRAY [] = }; -static const size_t MAP_ICON_COUNT = - sizeof (MAP_ICON_ARRAY) / sizeof (MAP_ICON_ARRAY [0]); +static const size_t MAP_ICON_COUNT = + sizeof(MAP_ICON_ARRAY) / sizeof(MAP_ICON_ARRAY [0]); /** the same for icons with local lock */ static const MapItem MAP_LOCK_ICON_ARRAY [] = @@ -606,8 +606,8 @@ static const MapItem MAP_LOCK_ICON_ARRAY [] = MAP_ITEM(IMG_INDX_MODIFIED_NEWER, locked_modified_newer_file_png) }; -static const size_t MAP_LOCK_ICON_COUNT = - sizeof (MAP_LOCK_ICON_ARRAY) / sizeof (MAP_LOCK_ICON_ARRAY [0]); +static const size_t MAP_LOCK_ICON_COUNT = + sizeof(MAP_LOCK_ICON_ARRAY) / sizeof(MAP_LOCK_ICON_ARRAY [0]); /** the same for icons with repository lock */ static const MapItem MAP_REPLOCK_ICON_ARRAY [] = @@ -623,8 +623,8 @@ static const MapItem MAP_REPLOCK_ICON_ARRAY [] = MAP_ITEM(IMG_INDX_MODIFIED_NEWER, rep_locked_modified_newer_file_png) }; -static const size_t MAP_REPLOCK_ICON_COUNT = - sizeof (MAP_REPLOCK_ICON_ARRAY) / sizeof (MAP_REPLOCK_ICON_ARRAY [0]); +static const size_t MAP_REPLOCK_ICON_COUNT = + sizeof(MAP_REPLOCK_ICON_ARRAY) / sizeof(MAP_REPLOCK_ICON_ARRAY [0]); /** * private struct that hide implementation details @@ -672,38 +672,38 @@ struct FileListCtrl::Data int ColumnIndex [COL_COUNT]; int ColumnWidth [COL_COUNT]; - Data (); - ~Data (); + Data(); + ~Data(); int - GetImageIndex (const svn::Status & status); + GetImageIndex(const svn::Status & status); int - GetSortImageIndex (bool sortDown); + GetSortImageIndex(bool sortDown); int - GetRealColumn (int clickedColumn); + GetRealColumn(int clickedColumn); static int wxCALLBACK - CompareFunction (long item1, long item2, long sortData); + CompareFunction(long item1, long item2, long sortData); void - ReadConfig (); + ReadConfig(); void - WriteConfig (); + WriteConfig(); }; /** default constructor */ -FileListCtrl::Data::Data () - : Context (0), SortColumn (COL_NAME), - IncludePath (true), SortAscending (true), - DirtyColumns (true), FlatMode (false), - WithUpdate (false), ShowUnversioned (true), - IgnoreExternals (false), ShowIgnored(false), - IsRelative (false) +FileListCtrl::Data::Data() + : Context(0), SortColumn(COL_NAME), + IncludePath(true), SortAscending(true), + DirtyColumns(true), FlatMode(false), + WithUpdate(false), ShowUnversioned(true), + IgnoreExternals(false), ShowIgnored(false), + IsRelative(false) { - ImageListSmall = new wxImageList (16, 16, TRUE); + ImageListSmall = new wxImageList(16, 16, TRUE); /** * form neccessary ImageIndexArray and ImageListSmall arrays @@ -711,35 +711,35 @@ FileListCtrl::Data::Data () */ size_t i; size_t lock_offset = 0; - for(i=0; i < MAP_ICON_COUNT; i++) + for (i=0; i < MAP_ICON_COUNT; i++) { const MapItem & item = MAP_ICON_ARRAY [i]; ImageIndexArray [item.status + lock_offset] = i; - ImageListSmall->Add (EmbeddedBitmap(item.data, item.len)); + ImageListSmall->Add(EmbeddedBitmap(item.data, item.len)); } lock_offset += IMG_INDX_COUNT; - for(i=0; i < MAP_LOCK_ICON_COUNT; i++) + for (i=0; i < MAP_LOCK_ICON_COUNT; i++) { const MapItem & item = MAP_LOCK_ICON_ARRAY [i]; ImageIndexArray [item.status + lock_offset] = MAP_ICON_COUNT + i; - ImageListSmall->Add (EmbeddedBitmap(item.data, item.len)); + ImageListSmall->Add(EmbeddedBitmap(item.data, item.len)); } lock_offset += IMG_INDX_COUNT; - for(i=0; i < MAP_REPLOCK_ICON_COUNT; i++) + for (i=0; i < MAP_REPLOCK_ICON_COUNT; i++) { const MapItem & item = MAP_REPLOCK_ICON_ARRAY [i]; ImageIndexArray [item.status + lock_offset] = MAP_LOCK_ICON_COUNT + MAP_ICON_COUNT + i; - ImageListSmall->Add (EmbeddedBitmap(item.data, item.len)); + ImageListSmall->Add(EmbeddedBitmap(item.data, item.len)); } } /** destructor */ -FileListCtrl::Data::~Data () +FileListCtrl::Data::~Data() { delete ImageListSmall; } @@ -749,26 +749,26 @@ FileListCtrl::Data::~Data () * exceptions. */ int -FileListCtrl::Data::GetImageIndex (const svn::Status & status) +FileListCtrl::Data::GetImageIndex(const svn::Status & status) { int imageIndex = 0; size_t lock_offset = 0; - if (status.isRepLock ()) + if (status.isRepLock()) lock_offset = 2 * IMG_INDX_COUNT; - else if (status.isLocked ()) + else if (status.isLocked()) lock_offset = IMG_INDX_COUNT; bool newer = - (status.reposTextStatus () == svn_wc_status_modified) || - (status.reposPropStatus () == svn_wc_status_modified); + (status.reposTextStatus() == svn_wc_status_modified) || + (status.reposPropStatus() == svn_wc_status_modified); - if (status.isVersioned ()) + if (status.isVersioned()) { - int textIndex = status.textStatus (); - int propIndex = status.propStatus (); + int textIndex = status.textStatus(); + int propIndex = status.propStatus(); - if (IsDir (&status)) + if (IsDir(&status)) { if ((textIndex == svn_wc_status_modified) || (propIndex == svn_wc_status_modified)) { @@ -793,13 +793,13 @@ FileListCtrl::Data::GetImageIndex (const svn::Status & status) { if ((textIndex == svn_wc_status_normal) && (propIndex > svn_wc_status_normal)) { - if ((propIndex >= 0) && (propIndex <= IMG_INDX_COUNT) ) + if ((propIndex >= 0) && (propIndex <= IMG_INDX_COUNT)) imageIndex = ImageIndexArray[propIndex + lock_offset]; } else imageIndex = ImageIndexArray[textIndex + lock_offset]; } - + if (newer) { if (imageIndex == ImageIndexArray[svn_wc_status_normal + lock_offset]) @@ -811,15 +811,15 @@ FileListCtrl::Data::GetImageIndex (const svn::Status & status) } else { - wxString wxFullPath = Utf8ToLocal (status.path ()); + wxString wxFullPath = Utf8ToLocal(status.path()); // unversioned entries dont carry dir info // with them. must find this out by ourself - if (wxDirExists (wxFullPath)) + if (wxDirExists(wxFullPath)) { imageIndex = ImageIndexArray[IMG_INDX_FOLDER + lock_offset]; } - else if (wxFileExists (wxFullPath)) + else if (wxFileExists(wxFullPath)) { imageIndex = ImageIndexArray[svn_wc_status_unversioned + lock_offset]; } @@ -836,7 +836,7 @@ FileListCtrl::Data::GetImageIndex (const svn::Status & status) * A safe wrapper for getting images for sorting. */ inline int -FileListCtrl::Data::GetSortImageIndex (bool sortDown) +FileListCtrl::Data::GetSortImageIndex(bool sortDown) { if (sortDown) return ImageIndexArray[IMG_INDX_SORT_DOWN]; @@ -850,7 +850,7 @@ FileListCtrl::Data::GetSortImageIndex (bool sortDown) * invisible columns this translates to something completely different */ inline int -FileListCtrl::Data::GetRealColumn (int clickedColumn) +FileListCtrl::Data::GetRealColumn(int clickedColumn) { int skipped = 0; for (int i = 0; (i < COL_COUNT && (i < clickedColumn+skipped || !ColumnVisible[i])); i++) @@ -865,21 +865,21 @@ FileListCtrl::Data::GetRealColumn (int clickedColumn) * callback function for @a wxListCtrl::SortColumns */ int wxCALLBACK -FileListCtrl::Data::CompareFunction (long item1, long item2, long sortData) +FileListCtrl::Data::CompareFunction(long item1, long item2, long sortData) { svn::Status * ps1 = (svn::Status *) item1; svn::Status * ps2 = (svn::Status *) item2; - Data *data = (Data *) (sortData); + Data *data = (Data *)(sortData); // depening on absolute or relative we have to adapt the // length we take for "." - size_t compareLength = data->IsRelative ? 0 : data->Path.length (); + size_t compareLength = data->IsRelative ? 0 : data->Path.length(); if (ps1 && ps2) - return CompareItems (ps1, ps2, data->SortColumn, - data->SortAscending, - data->IncludePath, - compareLength); + return CompareItems(ps1, ps2, data->SortColumn, + data->SortAscending, + data->IncludePath, + compareLength); else return 0; } @@ -889,29 +889,29 @@ FileListCtrl::Data::CompareFunction (long item1, long item2, long sortData) * in this case the visibilty and width of the columns */ inline void -FileListCtrl::Data::ReadConfig () +FileListCtrl::Data::ReadConfig() { // Get settings from config file - wxConfigBase *config = wxConfigBase::Get (); + wxConfigBase *config = wxConfigBase::Get(); - SortColumn = config->Read (ConfigSortColumn, (long) 0); - SortAscending = config->Read (ConfigSortOrder, (long) 1) ? true : false; + SortColumn = config->Read(ConfigSortColumn, (long) 0); + SortAscending = config->Read(ConfigSortOrder, (long) 1) ? true : false; - config->Read (ConfigIncludePath, &IncludePath, (bool) true); - config->Read (ConfigWithUpdate, &WithUpdate); - config->Read (ConfigShowUnversioned, &ShowUnversioned, (bool) true); - config->Read (ConfigIgnoreExternals, &IgnoreExternals, (bool) false); - config->Read (ConfigShowIgnored, &ShowIgnored, (bool) false); + config->Read(ConfigIncludePath, &IncludePath, (bool) true); + config->Read(ConfigWithUpdate, &WithUpdate); + config->Read(ConfigShowUnversioned, &ShowUnversioned, (bool) true); + config->Read(ConfigIgnoreExternals, &IgnoreExternals, (bool) false); + config->Read(ConfigShowIgnored, &ShowIgnored, (bool) false); for (int col = 0; col < COL_COUNT; col++) { wxString key; - key.Printf (ConfigColumnVisibleFmt, ColumnList[col].name); - ColumnVisible[col] = config->Read (key, (long) 1) != 0; + key.Printf(ConfigColumnVisibleFmt, ColumnList[col].name); + ColumnVisible[col] = config->Read(key, (long) 1) != 0; - key.Printf (ConfigColumnWidthFmt, ColumnList[col].name); - long width = (long)GetDefaultWidth (col); - ColumnWidth[col] = config->Read (key, width); + key.Printf(ConfigColumnWidthFmt, ColumnList[col].name); + long width = (long)GetDefaultWidth(col); + ColumnWidth[col] = config->Read(key, width); } ColumnVisible[COL_PATH] = FlatMode; } @@ -920,103 +920,103 @@ FileListCtrl::Data::ReadConfig () * save the preferences for the filelist */ inline void -FileListCtrl::Data::WriteConfig () +FileListCtrl::Data::WriteConfig() { // Write settings to config file - wxConfigBase *config = wxConfigBase::Get (); + wxConfigBase *config = wxConfigBase::Get(); - config->Write (ConfigSortColumn, (long) SortColumn); - config->Write (ConfigIncludePath, IncludePath); - config->Write (ConfigSortOrder, (long) (SortAscending ? 1 : 0)); - config->Write (ConfigWithUpdate, WithUpdate); - config->Write (ConfigShowUnversioned, ShowUnversioned); - config->Write (ConfigIgnoreExternals, IgnoreExternals); - config->Write (ConfigShowIgnored, ShowIgnored); + config->Write(ConfigSortColumn, (long) SortColumn); + config->Write(ConfigIncludePath, IncludePath); + config->Write(ConfigSortOrder, (long)(SortAscending ? 1 : 0)); + config->Write(ConfigWithUpdate, WithUpdate); + config->Write(ConfigShowUnversioned, ShowUnversioned); + config->Write(ConfigIgnoreExternals, IgnoreExternals); + config->Write(ConfigShowIgnored, ShowIgnored); // loop through all the columns for (int col=0; col < COL_COUNT; col++) { wxString key; - key.Printf (ConfigColumnWidthFmt, ColumnList[col].name); - config->Write (key, (long) ColumnWidth[col]); + key.Printf(ConfigColumnWidthFmt, ColumnList[col].name); + config->Write(key, (long) ColumnWidth[col]); - key.Printf (ConfigColumnVisibleFmt, ColumnList[col].name); - config->Write (key, (long) ColumnVisible[col]); + key.Printf(ConfigColumnVisibleFmt, ColumnList[col].name); + config->Write(key, (long) ColumnVisible[col]); } } -BEGIN_EVENT_TABLE (FileListCtrl, wxListCtrl) - EVT_KEY_DOWN (FileListCtrl::OnKeyDown) - EVT_LIST_ITEM_ACTIVATED (FILELIST_CTRL, FileListCtrl::OnDoubleClick) - EVT_LIST_COL_CLICK (FILELIST_CTRL, FileListCtrl::OnColumnLeftClick) - EVT_LIST_COL_END_DRAG (FILELIST_CTRL, FileListCtrl::OnColumnEndDrag) - EVT_LIST_BEGIN_DRAG (FILELIST_CTRL, FileListCtrl::OnBeginDrag) - EVT_CONTEXT_MENU (FileListCtrl::OnContextMenu) - EVT_SET_FOCUS (FileListCtrl::OnSetFocus) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(FileListCtrl, wxListCtrl) + EVT_KEY_DOWN(FileListCtrl::OnKeyDown) + EVT_LIST_ITEM_ACTIVATED(FILELIST_CTRL, FileListCtrl::OnDoubleClick) + EVT_LIST_COL_CLICK(FILELIST_CTRL, FileListCtrl::OnColumnLeftClick) + EVT_LIST_COL_END_DRAG(FILELIST_CTRL, FileListCtrl::OnColumnEndDrag) + EVT_LIST_BEGIN_DRAG(FILELIST_CTRL, FileListCtrl::OnBeginDrag) + EVT_CONTEXT_MENU(FileListCtrl::OnContextMenu) + EVT_SET_FOCUS(FileListCtrl::OnSetFocus) +END_EVENT_TABLE() -FileListCtrl::FileListCtrl (wxWindow * parent, const wxWindowID id, - const wxPoint & pos, const wxSize & size) - : wxListView (parent, id, pos, size, wxLC_REPORT) +FileListCtrl::FileListCtrl(wxWindow * parent, const wxWindowID id, + const wxPoint & pos, const wxSize & size) + : wxListView(parent, id, pos, size, wxLC_REPORT) { - m = new Data (); + m = new Data(); // set this file list control to use the image list - SetImageList (m->ImageListSmall, wxIMAGE_LIST_SMALL); + SetImageList(m->ImageListSmall, wxIMAGE_LIST_SMALL); - m->ReadConfig (); + m->ReadConfig(); m->DirtyColumns = true; m->Parent = parent; } -FileListCtrl::~FileListCtrl () +FileListCtrl::~FileListCtrl() { - m->WriteConfig (); + m->WriteConfig(); - DeleteAllItems (); + DeleteAllItems(); delete m; } void -FileListCtrl::RefreshFileList (const wxString & path) +FileListCtrl::RefreshFileList(const wxString & path) { m->Path = path; - RefreshFileList (); + RefreshFileList(); } void -FileListCtrl::RefreshFileList () +FileListCtrl::RefreshFileList() { - svn::Path pathUtf8 (PathUtf8 (m->Path)); + svn::Path pathUtf8(PathUtf8(m->Path)); // store selection std::deque selection; long i; - for (i=GetFirstSelected (); i != -1; i = GetNextSelected (i)) + for (i=GetFirstSelected(); i != -1; i = GetNextSelected(i)) { - svn::Status const* status = reinterpret_cast(GetItemData (i)); - selection.push_back (status->path ()); + svn::Status const* status = reinterpret_cast(GetItemData(i)); + selection.push_back(status->path()); } - std::sort (selection.begin (), selection.end ()); - std::deque::const_iterator selBegin = selection.begin (), selEnd = selection.end (); + std::sort(selection.begin(), selection.end()); + std::deque::const_iterator selBegin = selection.begin(), selEnd = selection.end(); // store scroll position //int scrollPos = GetScrollPos (wxVERTICAL); - long topItem = GetTopItem (); - long focusedItem = GetFocusedItem (); + long topItem = GetTopItem(); + long focusedItem = GetFocusedItem(); // freeze update to speed up processing. - Freeze (); + Freeze(); try { // delete all the items in the list to display the new ones - DeleteAllItems (); + DeleteAllItems(); - UpdateColumns (); + UpdateColumns(); - wxLogStatus (_("Listing entries in '%s'"), m->Path.c_str ()); + wxLogStatus(_("Listing entries in '%s'"), m->Path.c_str()); - svn::Client client (m->Context); + svn::Client client(m->Context); svn::StatusEntries statusSelector; svn::StatusFilter filter; filter.showUnversioned = m->ShowUnversioned; @@ -1026,40 +1026,40 @@ FileListCtrl::RefreshFileList () filter.showIgnored = m->ShowIgnored; filter.showExternals = !m->IgnoreExternals; - // Workaround for issue 324 (only local+non-flat+update): + // Workaround for issue 324 (only local+non-flat+update): // we chdir to the requested dir and pass "." to svn - if (!pathUtf8.isUrl () && m->WithUpdate && !m->FlatMode) + if (!pathUtf8.isUrl() && m->WithUpdate && !m->FlatMode) { m->IsRelative = true; - ::wxSetWorkingDirectory (m->Path); + ::wxSetWorkingDirectory(m->Path); // "" is the canonical expression for "." - client.status ("", filter, m->FlatMode, - m->WithUpdate, statusSelector); + client.status("", filter, m->FlatMode, + m->WithUpdate, statusSelector); } else { m->IsRelative = false; - client.status (pathUtf8.c_str (), filter, m->FlatMode, - m->WithUpdate, statusSelector); + client.status(pathUtf8.c_str(), filter, m->FlatMode, + m->WithUpdate, statusSelector); } svn::StatusEntries::const_iterator it; - for (it = statusSelector.begin (); it != statusSelector.end (); it++) + for (it = statusSelector.begin(); it != statusSelector.end(); it++) { const svn::Status & status = *it; - CreateLables (status, pathUtf8); + CreateLables(status, pathUtf8); // trying to restore selection - if (std::binary_search (selBegin, selEnd, status.path ())) + if (std::binary_search(selBegin, selEnd, status.path())) { - i=GetItemCount ()-1; + i=GetItemCount()-1; wxASSERT(i >= 0); - Select (i, true); + Select(i, true); } } - SortItems (Data::CompareFunction, (long) this->m); + SortItems(Data::CompareFunction, (long) this->m); // reenable window update after Freeze() Thaw(); @@ -1077,17 +1077,17 @@ FileListCtrl::RefreshFileList () // report about failure, mainly this related for relatively big lists // and only for positions closer to the end of it wxRect ir, cr; - GetItemRect (topItem, ir); - GetItemRect (GetTopItem (), cr); - ScrollList (0, ir.GetTop () - cr.GetTop ()); + GetItemRect(topItem, ir); + GetItemRect(GetTopItem(), cr); + ScrollList(0, ir.GetTop() - cr.GetTop()); Focus(focusedItem); - wxLogStatus (_("Ready"),""); + wxLogStatus(_("Ready"),""); } void -FileListCtrl::CreateLables (const svn::Status & status, const svn::Path & basePathUtf8) +FileListCtrl::CreateLables(const svn::Status & status, const svn::Path & basePathUtf8) { wxString values[COL_COUNT]; svn::Path fullPath; @@ -1096,7 +1096,7 @@ FileListCtrl::CreateLables (const svn::Status & status, const svn::Path & basePa if (m->IsRelative) { - const char * path = status.path (); + const char * path = status.path(); pathUtf8 = path; fullPath = basePathUtf8; @@ -1108,87 +1108,87 @@ FileListCtrl::CreateLables (const svn::Status & status, const svn::Path & basePa values[COL_NAME] = wxT("."); else { - values[COL_NAME] = Utf8ToLocal (pathUtf8.basename ()); - fullPath.addComponent (path); + values[COL_NAME] = Utf8ToLocal(pathUtf8.basename()); + fullPath.addComponent(path); } } else { - fullPath = status.path (); - - size_t basePathUtf8Length = basePathUtf8.length () + 1; - pathUtf8 = (fullPath.substr (basePathUtf8Length)); - pathUtf8 = pathUtf8.unescape (); + fullPath = status.path(); + + size_t basePathUtf8Length = basePathUtf8.length() + 1; + pathUtf8 = (fullPath.substr(basePathUtf8Length)); + pathUtf8 = pathUtf8.unescape(); // if we have a basePathUtf8 like // /home/foo/dir // then we know /home/foo/dir means "." // and /home/foo/dir/file1 is "file1" - isDot = fullPath.length () <= basePathUtf8Length; + isDot = fullPath.length() <= basePathUtf8Length; if (isDot) values[COL_NAME] = wxT("."); else - values[COL_NAME] = Utf8ToLocal (pathUtf8.basename ()); + values[COL_NAME] = Utf8ToLocal(pathUtf8.basename()); } - const bool isUrl (basePathUtf8.isUrl ()); + const bool isUrl(basePathUtf8.isUrl()); if (m->ColumnVisible[COL_PATH] || m->ColumnVisible[COL_EXTENSION]) { std::string dir, filename, ext; - fullPath.split (dir, filename, ext); + fullPath.split(dir, filename, ext); if (isDot) values[COL_PATH] = wxT("."); else { if (isUrl) - values[COL_PATH] = Utf8ToLocal (pathUtf8.c_str ()); + values[COL_PATH] = Utf8ToLocal(pathUtf8.c_str()); else - values[COL_PATH] = Utf8ToLocal (pathUtf8.native ()); + values[COL_PATH] = Utf8ToLocal(pathUtf8.native()); } - values[COL_EXTENSION] = Utf8ToLocal (ext); + values[COL_EXTENSION] = Utf8ToLocal(ext); } - int i = GetItemCount (); - int imageIndex = m->GetImageIndex (status); + int i = GetItemCount(); + int imageIndex = m->GetImageIndex(status); // User want to see unversioned entries? if (status.isVersioned() || m->ShowUnversioned) { - InsertItem (i, values[COL_NAME], imageIndex); + InsertItem(i, values[COL_NAME], imageIndex); // The item data will be used to sort the list: - SetItemData (i, (long) new svn::Status (status)); // The control now owns this data + SetItemData(i, (long) new svn::Status(status)); // The control now owns this data // and must delete it in due course. - if (status.isVersioned ()) + if (status.isVersioned()) { - const svn::Entry & entry = status.entry (); + const svn::Entry & entry = status.entry(); - values[COL_REV].Printf (wxT("%ld"), entry.revision ()); - values[COL_CMT_REV].Printf (wxT("%ld"), entry.cmtRev ()); + values[COL_REV].Printf(wxT("%ld"), entry.revision()); + values[COL_CMT_REV].Printf(wxT("%ld"), entry.cmtRev()); - values[COL_AUTHOR] = Utf8ToLocal (entry.cmtAuthor ()); + values[COL_AUTHOR] = Utf8ToLocal(entry.cmtAuthor()); // date formatting - values[COL_CMT_DATE] = FormatDateTime (entry.cmtDate ()); - values[COL_TEXT_TIME] = FormatDateTime (entry.textTime ()); - values[COL_PROP_TIME] = FormatDateTime (entry.propTime ()); + values[COL_CMT_DATE] = FormatDateTime(entry.cmtDate()); + values[COL_TEXT_TIME] = FormatDateTime(entry.textTime()); + values[COL_PROP_TIME] = FormatDateTime(entry.propTime()); - if (status.isLocked ()) + if (status.isLocked()) { - values[COL_LOCK_OWNER] = Utf8ToLocal (status.lockOwner ()); - values[COL_LOCK_COMMENT] = Utf8ToLocal (status.lockComment ()); + values[COL_LOCK_OWNER] = Utf8ToLocal(status.lockOwner()); + values[COL_LOCK_COMMENT] = Utf8ToLocal(status.lockComment()); } - values[COL_URL] = Utf8ToLocal (entry.url ()); - values[COL_REPOS] = Utf8ToLocal (entry.repos ()); - values[COL_UUID] = Utf8ToLocal (entry.uuid ()); + values[COL_URL] = Utf8ToLocal(entry.url()); + values[COL_REPOS] = Utf8ToLocal(entry.repos()); + values[COL_UUID] = Utf8ToLocal(entry.uuid()); wxString schedule; - switch (entry.schedule ()) + switch (entry.schedule()) { case svn_wc_schedule_add: schedule = _("add"); @@ -1204,45 +1204,45 @@ FileListCtrl::CreateLables (const svn::Status & status, const svn::Path & basePa } values[COL_SCHEDULE] = schedule; - if (entry.isCopied ()) + if (entry.isCopied()) { - wxString tmp (Utf8ToLocal (entry.copyfromUrl())); - values[COL_COPIED].Printf (wxT("%s, %ld"), - tmp.c_str (), - entry.copyfromRev ()); + wxString tmp(Utf8ToLocal(entry.copyfromUrl())); + values[COL_COPIED].Printf(wxT("%s, %ld"), + tmp.c_str(), + entry.copyfromRev()); } - values[COL_CONFLICT_OLD] = Utf8ToLocal (entry.conflictOld ()); - values[COL_CONFLICT_NEW] = Utf8ToLocal (entry.conflictNew ()); - values[COL_CONFLICT_WRK] = Utf8ToLocal (entry.conflictWrk ()); - values[COL_CHECKSUM] = Utf8ToLocal (entry.checksum ()); + values[COL_CONFLICT_OLD] = Utf8ToLocal(entry.conflictOld()); + values[COL_CONFLICT_NEW] = Utf8ToLocal(entry.conflictNew()); + values[COL_CONFLICT_WRK] = Utf8ToLocal(entry.conflictWrk()); + values[COL_CHECKSUM] = Utf8ToLocal(entry.checksum()); } - switch (status.textStatus ()) + switch (status.textStatus()) { case svn_wc_status_none: break; case svn_wc_status_normal: // empty text - if (status.reposTextStatus () == svn_wc_status_modified) + if (status.reposTextStatus() == svn_wc_status_modified) values[COL_TEXT_STATUS] = _("outdated"); break; default: values[COL_TEXT_STATUS] = - StatusDescription (status.textStatus ()); + StatusDescription(status.textStatus()); break; } - switch (status.propStatus ()) + switch (status.propStatus()) { case svn_wc_status_none: break; case svn_wc_status_normal: // empty text - if (status.reposPropStatus () == svn_wc_status_modified) + if (status.reposPropStatus() == svn_wc_status_modified) values[COL_PROP_STATUS] = _("outdated"); break; default: values[COL_PROP_STATUS] = - StatusDescription (status.propStatus ()); + StatusDescription(status.propStatus()); break; } @@ -1253,104 +1253,104 @@ FileListCtrl::CreateLables (const svn::Status & status, const svn::Path & basePa { int index = m->ColumnIndex[col]; if (index != -1) - SetItem (i, index, values[col]); + SetItem(i, index, values[col]); } } } const IndexArray -FileListCtrl::GetSelectedItems () const +FileListCtrl::GetSelectedItems() const { - int sel = GetSelectedItemCount (); + int sel = GetSelectedItemCount(); IndexArray indx_arr; if (sel <= 0) - indx_arr.Clear (); + indx_arr.Clear(); else { - indx_arr.Alloc (sel); + indx_arr.Alloc(sel); long item = -1; for (;;) { - item = GetNextItem (item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); + item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (item == -1) break; - indx_arr.Add (item); + indx_arr.Add(item); } } - sel = indx_arr.GetCount (); + sel = indx_arr.GetCount(); return indx_arr; } const svn::StatusSel & -FileListCtrl::GetStatusSel () const +FileListCtrl::GetStatusSel() const { - m->statusSel.clear (); + m->statusSel.clear(); - IndexArray arr = GetSelectedItems (); + IndexArray arr = GetSelectedItems(); size_t i; - m->statusSel.reserve (arr.GetCount ()); + m->statusSel.reserve(arr.GetCount()); - for (i = 0; i < arr.GetCount (); i++) + for (i = 0; i < arr.GetCount(); i++) { - const int index = arr.Item (i); - svn::Status * status = (svn::Status*)GetItemData (index); + const int index = arr.Item(i); + svn::Status * status = (svn::Status*)GetItemData(index); if (status == 0) continue; - m->statusSel.push_back (*status); + m->statusSel.push_back(*status); } return m->statusSel; } svn::Context * -FileListCtrl::GetContext () const +FileListCtrl::GetContext() const { return m->Context; } void -FileListCtrl::SetContext (svn::Context * Context) +FileListCtrl::SetContext(svn::Context * Context) { m->Context = Context; } void -FileListCtrl::OnKeyDown (wxKeyEvent & event) +FileListCtrl::OnKeyDown(wxKeyEvent & event) { - switch (event.GetKeyCode ()) + switch (event.GetKeyCode()) { - case WXK_RETURN: - if (!PostMenuEvent (this, ID_Default_Action)) - event.Skip (); - break; + case WXK_RETURN: + if (!PostMenuEvent(this, ID_Default_Action)) + event.Skip(); + break; - default: - event.Skip (); - break; + default: + event.Skip(); + break; } } void -FileListCtrl::OnDoubleClick (wxListEvent & event) +FileListCtrl::OnDoubleClick(wxListEvent & event) { - PostMenuEvent (this, ID_Default_Action); + PostMenuEvent(this, ID_Default_Action); } void -FileListCtrl::OnColumnLeftClick (wxListEvent & event) +FileListCtrl::OnColumnLeftClick(wxListEvent & event) { - int clickedColumn = event.GetColumn (); + int clickedColumn = event.GetColumn(); // First we have to get the real column - int column = m->GetRealColumn (clickedColumn); + int column = m->GetRealColumn(clickedColumn); // A second click on the current sort column reverses the order of sorting. if (column == m->SortColumn) @@ -1363,29 +1363,29 @@ FileListCtrl::OnColumnLeftClick (wxListEvent & event) m->SortAscending = true; } - ApplySortChanges (); + ApplySortChanges(); - ActionEvent Event (m->Parent, TOKEN_UPDATE_ASCENDING); - Event.Post (); + ActionEvent Event(m->Parent, TOKEN_UPDATE_ASCENDING); + Event.Post(); - Event.init (m->Parent, TOKEN_UPDATE_SORTING); - Event.Post (); + Event.init(m->Parent, TOKEN_UPDATE_SORTING); + Event.Post(); } void -FileListCtrl::OnColumnEndDrag (wxListEvent & event) +FileListCtrl::OnColumnEndDrag(wxListEvent & event) { - int index = event.GetColumn (); + int index = event.GetColumn(); // TODO clean this mess up. We dont want #ifdef's in the source code #ifdef __WXMSW__ // this works only with wxMSW - const wxListItem item = event.GetItem (); - const int width = item.GetWidth (); + const wxListItem item = event.GetItem(); + const int width = item.GetWidth(); #else // and this is for all the other platforms - const int width = GetColumnWidth (index); + const int width = GetColumnWidth(index); #endif for (int col = 0; col < COL_COUNT; col++) { @@ -1395,56 +1395,56 @@ FileListCtrl::OnColumnEndDrag (wxListEvent & event) break; } } - event.Skip (); + event.Skip(); } void -FileListCtrl::OnContextMenu (wxContextMenuEvent & event) +FileListCtrl::OnContextMenu(wxContextMenuEvent & event) { - wxPoint clientPt (ScreenToClient (event.GetPosition ())); - ShowMenu (clientPt); + wxPoint clientPt(ScreenToClient(event.GetPosition())); + ShowMenu(clientPt); } void -FileListCtrl::ShowMenu (wxPoint & pt) +FileListCtrl::ShowMenu(wxPoint & pt) { wxMenu menu; // if there is exactly one file selected, then // we are going to add filetype specific entries - if (GetSelectedItemCount () == 1) + if (GetSelectedItemCount() == 1) { - long item = GetNextItem (-1, wxLIST_NEXT_ALL, - wxLIST_STATE_SELECTED); - svn::Status * status = (svn::Status*)GetItemData (item); + long item = GetNextItem(-1, wxLIST_NEXT_ALL, + wxLIST_STATE_SELECTED); + svn::Status * status = (svn::Status*)GetItemData(item); - AppendVerbMenu (&menu, status); + AppendVerbMenu(&menu, status); } - AppendModifyMenu (&menu); - menu.AppendSeparator (); - AppendQueryMenu (&menu); + AppendModifyMenu(&menu); + menu.AppendSeparator(); + AppendQueryMenu(&menu); // Check for disabled items - RapidSvnFrame* frame = (RapidSvnFrame*) wxGetApp ().GetTopWindow (); - frame->TrimDisabledMenuItems (menu); + RapidSvnFrame* frame = (RapidSvnFrame*) wxGetApp().GetTopWindow(); + frame->TrimDisabledMenuItems(menu); - PopupMenu (&menu); + PopupMenu(&menu); } inline void -FileListCtrl::DeleteItem (long item) +FileListCtrl::DeleteItem(long item) { - svn::Status * p = (svn::Status *) GetItemData (item); + svn::Status * p = (svn::Status *) GetItemData(item); if (p) { delete p; } - wxListCtrl::DeleteItem (item); + wxListCtrl::DeleteItem(item); } void -FileListCtrl::SetColumnImages () +FileListCtrl::SetColumnImages() { // Update the column titles to reflect the sort column. for (int col = 0; col < COL_COUNT; col++) @@ -1458,35 +1458,35 @@ FileListCtrl::SetColumnImages () if (col == m->SortColumn) { bool sortDown = m->SortAscending ? true : false; - item.m_image = m->GetSortImageIndex (sortDown); + item.m_image = m->GetSortImageIndex(sortDown); } else { item.m_image = -1; } - SetColumn (index, item); + SetColumn(index, item); } } void -FileListCtrl::UpdateColumns () +FileListCtrl::UpdateColumns() { if (!m->DirtyColumns) return; // delete all items - DeleteAllItems (); + DeleteAllItems(); // adapt the column count - while (GetColumnCount () > 0) + while (GetColumnCount() > 0) { - DeleteColumn (0); + DeleteColumn(0); } // rebuild the index of columns wxListItem item; - item.SetMask (wxLIST_MASK_TEXT | wxLIST_MASK_WIDTH); - item.SetImage (-1); + item.SetMask(wxLIST_MASK_TEXT | wxLIST_MASK_WIDTH); + item.SetImage(-1); int index = 0; int col; @@ -1496,9 +1496,9 @@ FileListCtrl::UpdateColumns () { m->ColumnIndex[col] = index; - item.SetText (m->ColumnList[col].caption); - item.SetWidth (m->ColumnWidth[col]); - InsertColumn (index, item); + item.SetText(m->ColumnList[col].caption); + item.SetWidth(m->ColumnWidth[col]); + InsertColumn(index, item); index++; } @@ -1508,20 +1508,20 @@ FileListCtrl::UpdateColumns () } } - SetColumnImages (); + SetColumnImages(); m->DirtyColumns = false; } inline void -FileListCtrl::ApplySortChanges () +FileListCtrl::ApplySortChanges() { - SetColumnImages (); - SortItems (Data::CompareFunction, (long) this->m); + SetColumnImages(); + SortItems(Data::CompareFunction, (long) this->m); } void -FileListCtrl::ResetColumns () +FileListCtrl::ResetColumns() { for (int col=0; col < COL_COUNT; col++) { @@ -1550,30 +1550,30 @@ FileListCtrl::ResetColumns () visible = true; break; } - SetColumnVisible (col, visible); - SetColumnWidth (col, GetDefaultWidth (col)); + SetColumnVisible(col, visible); + SetColumnWidth(col, GetDefaultWidth(col)); m->DirtyColumns = true; } } void -FileListCtrl::DeleteAllItems () +FileListCtrl::DeleteAllItems() { // Delete the item data before deleting the items: - for (int i = 0; i < GetItemCount (); i++) + for (int i = 0; i < GetItemCount(); i++) { - svn::Status * p = (svn::Status *) GetItemData (i); + svn::Status * p = (svn::Status *) GetItemData(i); if (p) { delete p; - SetItemData (i, 0); + SetItemData(i, 0); } } - wxListCtrl::DeleteAllItems (); + wxListCtrl::DeleteAllItems(); } void -FileListCtrl::SetColumnVisible (const int col, const bool visible) +FileListCtrl::SetColumnVisible(const int col, const bool visible) { if (col == COL_NAME) return; @@ -1592,7 +1592,7 @@ FileListCtrl::SetColumnVisible (const int col, const bool visible) } bool -FileListCtrl::GetColumnVisible (const int col) const +FileListCtrl::GetColumnVisible(const int col) const { if ((col >= 0) && (col < COL_COUNT)) { @@ -1605,25 +1605,25 @@ FileListCtrl::GetColumnVisible (const int col) const } inline void -FileListCtrl::SetColumnWidth (const int col, const int width) +FileListCtrl::SetColumnWidth(const int col, const int width) { m->ColumnWidth[col] = width; int index = m->ColumnIndex[col]; if (index != -1) { - wxListCtrl::SetColumnWidth (index, width); + wxListCtrl::SetColumnWidth(index, width); } } int -FileListCtrl::GetSortColumn () const +FileListCtrl::GetSortColumn() const { return m->SortColumn; } void -FileListCtrl::SetSortColumn (const int col) +FileListCtrl::SetSortColumn(const int col) { if (col >= 0 && col <= COL_COUNT) m->SortColumn = col; @@ -1631,142 +1631,142 @@ FileListCtrl::SetSortColumn (const int col) bool -FileListCtrl::GetIncludePath () const +FileListCtrl::GetIncludePath() const { return m->IncludePath; } void -FileListCtrl::SetIncludePath (bool value) +FileListCtrl::SetIncludePath(bool value) { m->IncludePath = value; - ApplySortChanges (); + ApplySortChanges(); } bool -FileListCtrl::GetSortAscending () const +FileListCtrl::GetSortAscending() const { return m->SortAscending; } void -FileListCtrl::SetSortAscending (bool ascending) +FileListCtrl::SetSortAscending(bool ascending) { m->SortAscending = ascending; - ApplySortChanges (); + ApplySortChanges(); } bool -FileListCtrl::IsFlat () const +FileListCtrl::IsFlat() const { return m->FlatMode; } void -FileListCtrl::SetFlat (const bool flat) +FileListCtrl::SetFlat(const bool flat) { m->FlatMode = flat; - SetColumnVisible (COL_PATH, flat); + SetColumnVisible(COL_PATH, flat); } bool -FileListCtrl::GetWithUpdate () const +FileListCtrl::GetWithUpdate() const { return m->WithUpdate; } void -FileListCtrl::SetWithUpdate (bool value) +FileListCtrl::SetWithUpdate(bool value) { m->WithUpdate = value; } bool -FileListCtrl::GetShowUnversioned () const +FileListCtrl::GetShowUnversioned() const { return m->ShowUnversioned; } void -FileListCtrl::SetShowUnversioned (bool value) +FileListCtrl::SetShowUnversioned(bool value) { m->ShowUnversioned = value; } void -FileListCtrl::SetShowUnmodified (bool value) +FileListCtrl::SetShowUnmodified(bool value) { m->ShowUnmodified = value; } -void -FileListCtrl::SetShowModified (bool value) +void +FileListCtrl::SetShowModified(bool value) { m->ShowModified = value; } - + void -FileListCtrl::SetShowConflicted (bool value) +FileListCtrl::SetShowConflicted(bool value) { m->ShowConflicted = value; } bool -FileListCtrl::GetIgnoreExternals () const +FileListCtrl::GetIgnoreExternals() const { return m->IgnoreExternals; } void -FileListCtrl::SetIgnoreExternals (bool value) +FileListCtrl::SetIgnoreExternals(bool value) { m->IgnoreExternals = value; } bool -FileListCtrl::GetShowIgnored () const +FileListCtrl::GetShowIgnored() const { return m->ShowIgnored; } void -FileListCtrl::SetShowIgnored (bool value) +FileListCtrl::SetShowIgnored(bool value) { m->ShowIgnored = value; } void -FileListCtrl::OnBeginDrag (wxListEvent & event) +FileListCtrl::OnBeginDrag(wxListEvent & event) { - IndexArray arr = GetSelectedItems (); + IndexArray arr = GetSelectedItems(); wxFileDataObject data; - for (unsigned int i = 0; i < arr.GetCount (); i++) + for (unsigned int i = 0; i < arr.GetCount(); i++) { - const int index = arr.Item (i); - svn::Status * status = (svn::Status*)GetItemData (index); - data.AddFile (FullNativePath (status->path (), m->Path, m->FlatMode)); + const int index = arr.Item(i); + svn::Status * status = (svn::Status*)GetItemData(index); + data.AddFile(FullNativePath(status->path(), m->Path, m->FlatMode)); } - - wxDropSource dropSource (this); - dropSource.SetData (data); - /** + + wxDropSource dropSource(this); + dropSource.SetData(data); + /** * @todo we dont seem to need result * wxDragResult result = dropSource.DoDragDrop (true); */ - dropSource.DoDragDrop (); + dropSource.DoDragDrop(); } -void -FileListCtrl::OnSetFocus (wxFocusEvent & event) +void +FileListCtrl::OnSetFocus(wxFocusEvent & event) { // forward this event to the parent - wxCommandEvent newEvent (wxEVT_COMMAND_MENU_SELECTED, event.GetId ()); - wxPostEvent (GetParent (), newEvent); + wxCommandEvent newEvent(wxEVT_COMMAND_MENU_SELECTED, event.GetId()); + wxPostEvent(GetParent(), newEvent); // don't stop default process event.Skip(); diff --git a/src/filelist_ctrl.hpp b/src/filelist_ctrl.hpp index 32af840f..2c04303a 100644 --- a/src/filelist_ctrl.hpp +++ b/src/filelist_ctrl.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -32,9 +32,9 @@ * Define an array of indexes of the selected items. */ #ifdef WX_DEFINE_ARRAY_LONG -WX_DEFINE_ARRAY_LONG (long, IndexArray); +WX_DEFINE_ARRAY_LONG(long, IndexArray); #else -WX_DEFINE_ARRAY (long, IndexArray); +WX_DEFINE_ARRAY(long, IndexArray); #endif // forward declarations @@ -87,13 +87,13 @@ class FileListCtrl : public wxListView } FileListColumns; - FileListCtrl (wxWindow * parent, const wxWindowID id, - const wxPoint & pos, const wxSize & size); + FileListCtrl(wxWindow * parent, const wxWindowID id, + const wxPoint & pos, const wxSize & size); - virtual ~FileListCtrl (); + virtual ~FileListCtrl(); - void ResetColumns (); - void DeleteAllItems (); + void ResetColumns(); + void DeleteAllItems(); /** * set visibility of a column @@ -102,7 +102,7 @@ class FileListCtrl : public wxListView * @param visible */ void - SetColumnVisible (const int col, const bool visible); + SetColumnVisible(const int col, const bool visible); /** * @param col column number @@ -110,7 +110,7 @@ class FileListCtrl : public wxListView * @retval false invisible */ bool - GetColumnVisible (const int col) const; + GetColumnVisible(const int col) const; /** * set column width @@ -119,7 +119,7 @@ class FileListCtrl : public wxListView * @param width */ void - SetColumnWidth (const int col, const int width); + SetColumnWidth(const int col, const int width); /** * get number of soring column @@ -127,7 +127,7 @@ class FileListCtrl : public wxListView * @return number of column */ int - GetSortColumn () const; + GetSortColumn() const; /** * set sorting column @@ -135,7 +135,7 @@ class FileListCtrl : public wxListView * @param col column number */ void - SetSortColumn (const int col); + SetSortColumn(const int col); /** * know whether to use full path in sorting @@ -143,7 +143,7 @@ class FileListCtrl : public wxListView * @return true = use full path */ bool - GetIncludePath () const; + GetIncludePath() const; /** * set whether to use full path in sorting @@ -151,7 +151,7 @@ class FileListCtrl : public wxListView * @param value */ void - SetIncludePath (bool value); + SetIncludePath(bool value); /** * know whether sorting is ascending or descending @@ -159,7 +159,7 @@ class FileListCtrl : public wxListView * @return true = ascending */ bool - GetSortAscending () const; + GetSortAscending() const; /** * set whether to sort ascending or descending @@ -167,7 +167,7 @@ class FileListCtrl : public wxListView * @param ascending */ void - SetSortAscending (bool ascending); + SetSortAscending(bool ascending); /** * get the "flat" setting @@ -175,7 +175,7 @@ class FileListCtrl : public wxListView * @return true = flat */ bool - IsFlat () const; + IsFlat() const; /** * change to either flat or single directory view @@ -185,76 +185,76 @@ class FileListCtrl : public wxListView * @param flat */ void - SetFlat (const bool flat); + SetFlat(const bool flat); /** * shall we contact the repository when updating, * so we get information about out-dated-ness? */ bool - GetWithUpdate () const; + GetWithUpdate() const; void - SetWithUpdate (bool value); + SetWithUpdate(bool value); bool - GetShowUnversioned () const; + GetShowUnversioned() const; /** * shall we display unversioned file entries? */ void - SetShowUnversioned (bool value); + SetShowUnversioned(bool value); void - SetShowUnmodified (bool value); + SetShowUnmodified(bool value); - void - SetShowModified (bool value); - void - SetShowConflicted (bool value); + SetShowModified(bool value); + + void + SetShowConflicted(bool value); /** * shall external definitions be ignored/not updated? */ bool - GetIgnoreExternals () const; + GetIgnoreExternals() const; void - SetIgnoreExternals (bool value); + SetIgnoreExternals(bool value); /** * shall we display ignored file entries? */ bool - GetShowIgnored () const; + GetShowIgnored() const; void - SetShowIgnored (bool value); + SetShowIgnored(bool value); - void RefreshFileList (); - void RefreshFileList (const wxString & path); + void RefreshFileList(); + void RefreshFileList(const wxString & path); const IndexArray - GetSelectedItems () const; + GetSelectedItems() const; - /** + /** * the selected @ref Status instances */ const svn::StatusSel & - GetStatusSel () const; + GetStatusSel() const; svn::Context * - GetContext () const; + GetContext() const; void - SetContext (svn::Context * Context); + SetContext(svn::Context * Context); /** * Makes sure the columns are updated correctly */ - void UpdateColumns (); + void UpdateColumns(); private: /** private data for this class */ @@ -262,25 +262,25 @@ class FileListCtrl : public wxListView Data * m; // utility methods - void ShowMenu (wxPoint & pt); - void DeleteItem (long item); + void ShowMenu(wxPoint & pt); + void DeleteItem(long item); - void SetColumnImages (); - void ApplySortChanges (); + void SetColumnImages(); + void ApplySortChanges(); // message handlers - void OnKeyDown (wxKeyEvent & event); - void OnDoubleClick (wxListEvent & event); - void OnColumnLeftClick (wxListEvent & event); - void OnColumnEndDrag (wxListEvent & event); - void OnContextMenu (wxContextMenuEvent & event); - void OnBeginDrag (wxListEvent & event); - void OnSetFocus (wxFocusEvent & event); + void OnKeyDown(wxKeyEvent & event); + void OnDoubleClick(wxListEvent & event); + void OnColumnLeftClick(wxListEvent & event); + void OnColumnEndDrag(wxListEvent & event); + void OnContextMenu(wxContextMenuEvent & event); + void OnBeginDrag(wxListEvent & event); + void OnSetFocus(wxFocusEvent & event); - void CreateLables (const svn::Status & status, const svn::Path & basePath); + void CreateLables(const svn::Status & status, const svn::Path & basePath); private: - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/filelist_ctrl_drop_target.cpp b/src/filelist_ctrl_drop_target.cpp index 6a604f58..28db11aa 100644 --- a/src/filelist_ctrl_drop_target.cpp +++ b/src/filelist_ctrl_drop_target.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,38 +37,38 @@ #include "utils.hpp" -FileListCtrlDropTarget::FileListCtrlDropTarget (FolderBrowser * browser, - FileListCtrl * parent) - : m_browser (browser), m_parent (parent) +FileListCtrlDropTarget::FileListCtrlDropTarget(FolderBrowser * browser, + FileListCtrl * parent) + : m_browser(browser), m_parent(parent) { } wxString -FileListCtrlDropTarget::GetDestinationPath (const wxPoint & point) +FileListCtrlDropTarget::GetDestinationPath(const wxPoint & point) { wxString path = wxEmptyString; int flags = wxLIST_HITTEST_ONITEM; - long destinationItem = m_parent->HitTest (point, flags); + long destinationItem = m_parent->HitTest(point, flags); if (destinationItem != wxNOT_FOUND) // Did we land on an item?? { - svn::Status * status = - (svn::Status*)m_parent->GetItemData (destinationItem); - if (status->isVersioned () && - (status->entry ().kind() == svn_node_dir)) + svn::Status * status = + (svn::Status*)m_parent->GetItemData(destinationItem); + if (status->isVersioned() && + (status->entry().kind() == svn_node_dir)) { - path = FullNativePath (svn::Path (status->path ()), - m_browser->GetSelectedItemData ()->getPath (), m_parent->IsFlat ()); + path = FullNativePath(svn::Path(status->path()), + m_browser->GetSelectedItemData()->getPath(), m_parent->IsFlat()); } } - // If the path is still empty, then the hit test was on an - // unversioned item, it wasn't on an item at all, or it + // If the path is still empty, then the hit test was on an + // unversioned item, it wasn't on an item at all, or it // wasn't a directory: // Get the path from the folder browser - if (path.IsEmpty ()) + if (path.IsEmpty()) { // Get the path from the folder browser - path = m_browser->GetSelectedItemData ()->getPath (); + path = m_browser->GetSelectedItemData()->getPath(); } return path; diff --git a/src/filelist_ctrl_drop_target.hpp b/src/filelist_ctrl_drop_target.hpp index 4ab5cf8d..d0fa7647 100644 --- a/src/filelist_ctrl_drop_target.hpp +++ b/src/filelist_ctrl_drop_target.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -33,14 +33,14 @@ class FileListCtrl; class FileListCtrlDropTarget : public RapidSvnDropTarget { public: - FileListCtrlDropTarget (FolderBrowser * browser, - FileListCtrl * parent); - - virtual - ~FileListCtrlDropTarget () {} + FileListCtrlDropTarget(FolderBrowser * browser, + FileListCtrl * parent); - virtual wxString - GetDestinationPath (const wxPoint & point); + virtual + ~FileListCtrlDropTarget() {} + + virtual wxString + GetDestinationPath(const wxPoint & point); private: FolderBrowser * m_browser; diff --git a/src/folder_browser.cpp b/src/folder_browser.cpp index 34f32555..d26eb07f 100644 --- a/src/folder_browser.cpp +++ b/src/folder_browser.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -90,13 +90,13 @@ static const wxString EmptyString; // local functions static bool -IsValidSeparator (const wxString & sep) +IsValidSeparator(const wxString & sep) { return ((sep == wxT("/")) || (sep == wxT("\\"))); } -/** +/** * data structure that contains information about * a single bookmark */ @@ -106,18 +106,18 @@ struct Bookmark svn::Context * context; bool flatMode; - Bookmark (bool flatMode_=false) - : context (0), flatMode (flatMode_) + Bookmark(bool flatMode_=false) + : context(0), flatMode(flatMode_) { } - ~Bookmark () + ~Bookmark() { - ClearContext (); + ClearContext(); } void - ClearContext () + ClearContext() { if (context != 0) { @@ -127,16 +127,16 @@ struct Bookmark } void - SetAuthCache (bool value) + SetAuthCache(bool value) { if (context != 0) - context->setAuthCache (value); + context->setAuthCache(value); } }; static Bookmark InvalidBookmark; -WX_DECLARE_STRING_HASH_MAP (Bookmark, BookmarkHashMap); +WX_DECLARE_STRING_HASH_MAP(Bookmark, BookmarkHashMap); struct FolderBrowser::Data { @@ -152,33 +152,33 @@ struct FolderBrowser::Data svn::Context defaultContext; svn::StatusSel statusSel; - Data (wxTreeCtrl * treeCtrl_) - : singleContext (0), listener (0), useAuthCache (true), treeCtrl (treeCtrl_) + Data(wxTreeCtrl * treeCtrl_) + : singleContext(0), listener(0), useAuthCache(true), treeCtrl(treeCtrl_) { - imageList = new wxImageList (16, 16, TRUE); - imageList->Add (EMBEDDED_BITMAP(computer_png)); - imageList->Add (EMBEDDED_BITMAP(folder_png)); - imageList->Add (EMBEDDED_BITMAP(open_folder_png)); - imageList->Add (EMBEDDED_BITMAP(nonsvn_folder_png)); - imageList->Add (EMBEDDED_BITMAP(nonsvn_open_folder_png)); - imageList->Add (EMBEDDED_BITMAP(modified_folder_png)); - imageList->Add (EMBEDDED_BITMAP(modified_open_folder_png)); - imageList->Add (EMBEDDED_BITMAP(bookmark_png)); - imageList->Add (EMBEDDED_BITMAP(repository_bookmark_png)); - imageList->Add (EMBEDDED_BITMAP(externals_folder_png)); - imageList->Add (EMBEDDED_BITMAP(externals_open_folder_png)); - - treeCtrl->AssignImageList (imageList); - - FolderItemData* data = new FolderItemData (FOLDER_TYPE_BOOKMARKS); - rootId = treeCtrl->AddRoot (_("Bookmarks"), FOLDER_IMAGE_COMPUTER, - FOLDER_IMAGE_COMPUTER, data); - treeCtrl->SetItemHasChildren (rootId, TRUE); + imageList = new wxImageList(16, 16, TRUE); + imageList->Add(EMBEDDED_BITMAP(computer_png)); + imageList->Add(EMBEDDED_BITMAP(folder_png)); + imageList->Add(EMBEDDED_BITMAP(open_folder_png)); + imageList->Add(EMBEDDED_BITMAP(nonsvn_folder_png)); + imageList->Add(EMBEDDED_BITMAP(nonsvn_open_folder_png)); + imageList->Add(EMBEDDED_BITMAP(modified_folder_png)); + imageList->Add(EMBEDDED_BITMAP(modified_open_folder_png)); + imageList->Add(EMBEDDED_BITMAP(bookmark_png)); + imageList->Add(EMBEDDED_BITMAP(repository_bookmark_png)); + imageList->Add(EMBEDDED_BITMAP(externals_folder_png)); + imageList->Add(EMBEDDED_BITMAP(externals_open_folder_png)); + + treeCtrl->AssignImageList(imageList); + + FolderItemData* data = new FolderItemData(FOLDER_TYPE_BOOKMARKS); + rootId = treeCtrl->AddRoot(_("Bookmarks"), FOLDER_IMAGE_COMPUTER, + FOLDER_IMAGE_COMPUTER, data); + treeCtrl->SetItemHasChildren(rootId, TRUE); } - ~Data () + ~Data() { - DeleteAllItems (); + DeleteAllItems(); } /** @@ -188,136 +188,136 @@ struct FolderBrowser::Data * @param name full path/url of the bookmark */ void - AddBookmark (wxString name, bool flatMode) + AddBookmark(wxString name, bool flatMode) { - TrimString (name); - if (name.Last () == '/') - name.RemoveLast (); + TrimString(name); + if (name.Last() == '/') + name.RemoveLast(); - svn::Path nameUtf8 (PathUtf8 (name)); + svn::Path nameUtf8(PathUtf8(name)); if (!nameUtf8.isUrl()) { - wxFileName filename (name); - name = filename.GetFullPath (wxPATH_NATIVE); + wxFileName filename(name); + name = filename.GetFullPath(wxPATH_NATIVE); } - name = BeautifyPath (name); + name = BeautifyPath(name); + + bookmarks [name] = Bookmark(flatMode); - bookmarks [name] = Bookmark (flatMode); - if (singleContext == 0) - bookmarks [name].context = CreateContext (); + bookmarks [name].context = CreateContext(); } /** * factory method to create a new context */ svn::Context * - CreateContext () + CreateContext() { - svn::Context * context = new svn::Context (); + svn::Context * context = new svn::Context(); - context->setAuthCache (useAuthCache); - context->setListener (listener); + context->setAuthCache(useAuthCache); + context->setListener(listener); return context; } const wxString - GetPath () + GetPath() { - const wxTreeItemId id = treeCtrl->GetSelection (); + const wxTreeItemId id = treeCtrl->GetSelection(); - if(!id.IsOk()) + if (!id.IsOk()) { return wxEmptyString; } - FolderItemData* data = GetItemData (id); - return data->getPath (); + FolderItemData* data = GetItemData(id); + return data->getPath(); } const FolderItemData * - GetSelection () const + GetSelection() const { - const wxTreeItemId id = treeCtrl->GetSelection (); + const wxTreeItemId id = treeCtrl->GetSelection(); - if(!id.IsOk()) + if (!id.IsOk()) { return NULL; } else { - FolderItemData* data = GetItemData (id); + FolderItemData* data = GetItemData(id); return data; } } const FolderItemData * - HitTest (const wxPoint & point) const + HitTest(const wxPoint & point) const { - const wxTreeItemId id = treeCtrl->HitTest (point); + const wxTreeItemId id = treeCtrl->HitTest(point); - if(!id.IsOk ()) + if (!id.IsOk()) return 0; else { - FolderItemData* data = GetItemData (id); + FolderItemData* data = GetItemData(id); return data; } } svn::Context * - GetContext () + GetContext() { if (singleContext != 0) return singleContext; - const wxString & path = GetSelectedBookmarkPath (); + const wxString & path = GetSelectedBookmarkPath(); - if (path.Length () == 0) + if (path.Length() == 0) return &defaultContext; - BookmarkHashMap::iterator it = bookmarks.find (path); + BookmarkHashMap::iterator it = bookmarks.find(path); - if (it == bookmarks.end ()) + if (it == bookmarks.end()) return 0; return it->second.context; } void - ShowMenu (wxPoint & pt) + ShowMenu(wxPoint & pt) { // select right-clicked item const wxTreeItemId id = treeCtrl->HitTest(pt); - if(id.IsOk () && !(id == treeCtrl->GetSelection ())) - treeCtrl->SelectItem (id); + if (id.IsOk() && !(id == treeCtrl->GetSelection())) + treeCtrl->SelectItem(id); - const FolderItemData * data = GetSelection (); + const FolderItemData * data = GetSelection(); if (!data) return; - const svn::Context * context = GetContext (); + const svn::Context * context = GetContext(); // create menu wxMenu menu; - int type = data->getFolderType (); + int type = data->getFolderType(); - AppendMenuItem (menu, ID_AddWcBookmark); - AppendMenuItem (menu, ID_Checkout); - menu.AppendSeparator (); - AppendMenuItem (menu, ID_AddRepoBookmark); - AppendMenuItem (menu, ID_CreateRepository); - AppendMenuItem (menu, ID_Switch); + AppendMenuItem(menu, ID_AddWcBookmark); + AppendMenuItem(menu, ID_Checkout); + menu.AppendSeparator(); + AppendMenuItem(menu, ID_AddRepoBookmark); + AppendMenuItem(menu, ID_CreateRepository); + AppendMenuItem(menu, ID_Switch); if (type == FOLDER_TYPE_BOOKMARK) { - menu.AppendSeparator (); - AppendMenuItem (menu, ID_EditBookmark); - AppendMenuItem (menu, ID_RemoveBookmark); - menu.AppendSeparator (); - AppendMenuItem (menu, ID_Login); + menu.AppendSeparator(); + AppendMenuItem(menu, ID_EditBookmark); + AppendMenuItem(menu, ID_RemoveBookmark); + menu.AppendSeparator(); + AppendMenuItem(menu, ID_Login); wxString label; wxString username; @@ -325,49 +325,49 @@ struct FolderBrowser::Data if (context != 0) { - username = Utf8ToLocal (context->getUsername ()); + username = Utf8ToLocal(context->getUsername()); } - if (username.length () == 0) + if (username.length() == 0) { label = _("Logout"); } else { enabled = true; - label.Printf (_("Logout '%s'"), username.c_str ()); + label.Printf(_("Logout '%s'"), username.c_str()); } - wxMenuItem * item = new wxMenuItem (&menu, ID_Logout, label); - menu.Append (item); - item->Enable (enabled); + wxMenuItem * item = new wxMenuItem(&menu, ID_Logout, label); + menu.Append(item); + item->Enable(enabled); } if (type == FOLDER_TYPE_BOOKMARK || type == FOLDER_TYPE_NORMAL) { - menu.AppendSeparator (); - AppendMenuItem (menu, ID_Update); - AppendMenuItem (menu, ID_Commit); + menu.AppendSeparator(); + AppendMenuItem(menu, ID_Update); + AppendMenuItem(menu, ID_Commit); } // Check for disabled items - RapidSvnFrame* frame = (RapidSvnFrame*) wxGetApp ().GetTopWindow (); - frame->TrimDisabledMenuItems (menu); + RapidSvnFrame* frame = (RapidSvnFrame*) wxGetApp().GetTopWindow(); + frame->TrimDisabledMenuItems(menu); // show menu - treeCtrl->PopupMenu (&menu, pt); + treeCtrl->PopupMenu(&menu, pt); } bool - HasSubdirectories (const wxString & path) + HasSubdirectories(const wxString & path) { wxString filename; - wxDir dir (path); + wxDir dir(path); bool ok = dir.GetFirst(&filename, wxEmptyString, - wxDIR_DIRS); - if(!dir.IsOpened ()) + wxDIR_DIRS); + if (!dir.IsOpened()) return false; if (!ok) @@ -375,21 +375,21 @@ struct FolderBrowser::Data while (ok) { - if (!svn::Wc::isAdmDir (LocalToUtf8 (filename).c_str ())) + if (!svn::Wc::isAdmDir(LocalToUtf8(filename).c_str())) return true; - ok = dir.GetNext (&filename); + ok = dir.GetNext(&filename); } return false; } - void Delete (const wxTreeItemId & id) + void Delete(const wxTreeItemId & id) { - if( treeCtrl ) + if (treeCtrl) { wxTreeItemData * data = treeCtrl->GetItemData(id); - if( data ) + if (data) { delete data; treeCtrl->SetItemData(id, NULL); @@ -399,175 +399,175 @@ struct FolderBrowser::Data } } - void DeleteAllItems () + void DeleteAllItems() { if (treeCtrl) { - // this deletes all children and - // all of the itemdata + // this deletes all children and + // all of the itemdata #ifndef __WXMAC__ //wxMac crashes here - treeCtrl->Collapse (rootId); + treeCtrl->Collapse(rootId); #endif } } void - OnTreeKeyDown (wxTreeEvent & event) + OnTreeKeyDown(wxTreeEvent & event) { - int code = event.GetKeyCode (); + int code = event.GetKeyCode(); - if (treeCtrl->GetSelection ().IsOk () && - !treeCtrl->IsExpanded (treeCtrl->GetSelection ())) + if (treeCtrl->GetSelection().IsOk() && + !treeCtrl->IsExpanded(treeCtrl->GetSelection())) { if (code == '-' || code == WXK_LEFT) { - wxTreeItemId parentId ( - treeCtrl->GetItemParent(treeCtrl->GetSelection ())); + wxTreeItemId parentId( + treeCtrl->GetItemParent(treeCtrl->GetSelection())); // make sure parentId is okay // -> otherwise segfault (at least on wxGTK) - if (parentId.IsOk ()) - treeCtrl->Collapse (parentId); + if (parentId.IsOk()) + treeCtrl->Collapse(parentId); } } - event.Skip (); + event.Skip(); } void - OnExpandItem (wxTreeEvent & event) + OnExpandItem(wxTreeEvent & event) { - wxTreeItemId parentId = event.GetItem (); + wxTreeItemId parentId = event.GetItem(); int type = FOLDER_TYPE_INVALID; - // If the parent is already expanded, + // If the parent is already expanded, // nothing has to be done here - if (treeCtrl->IsExpanded (parentId)) + if (treeCtrl->IsExpanded(parentId)) return; - if(!rootId.IsOk ()) + if (!rootId.IsOk()) { - rootId = treeCtrl->GetRootItem (); + rootId = treeCtrl->GetRootItem(); } - FolderItemData* parentData = GetItemData (parentId); - if(parentData) + FolderItemData* parentData = GetItemData(parentId); + if (parentData) { - type = parentData->getFolderType (); + type = parentData->getFolderType(); } - switch(type) + switch (type) { - case FOLDER_TYPE_BOOKMARKS: + case FOLDER_TYPE_BOOKMARKS: + { + BookmarkHashMap::iterator it = bookmarks.begin(); + + for (; it!= bookmarks.end(); it++) { - BookmarkHashMap::iterator it = bookmarks.begin (); + const wxString & path = it->first; + svn::Path pathUtf8(PathUtf8(path)); + int image; - for (; it!= bookmarks.end (); it++) - { - const wxString & path = it->first; - svn::Path pathUtf8 (PathUtf8 (path)); - int image; - - if (pathUtf8.isUrl ()) - image = FOLDER_IMAGE_REPOSITORY_BOOKMARK; - else - image = FOLDER_IMAGE_BOOKMARK; - - FolderItemData* data= new FolderItemData (FOLDER_TYPE_BOOKMARK, - path, path, TRUE); - wxTreeItemId newId = treeCtrl->AppendItem (parentId, path, - image, image, data); - treeCtrl->SetItemHasChildren (newId, TRUE); - treeCtrl->SetItemImage (newId, image, - wxTreeItemIcon_Expanded); - } + if (pathUtf8.isUrl()) + image = FOLDER_IMAGE_REPOSITORY_BOOKMARK; + else + image = FOLDER_IMAGE_BOOKMARK; + + FolderItemData* data= new FolderItemData(FOLDER_TYPE_BOOKMARK, + path, path, TRUE); + wxTreeItemId newId = treeCtrl->AppendItem(parentId, path, + image, image, data); + treeCtrl->SetItemHasChildren(newId, TRUE); + treeCtrl->SetItemImage(newId, image, + wxTreeItemIcon_Expanded); } - break; + } + break; - case FOLDER_TYPE_BOOKMARK: - case FOLDER_TYPE_NORMAL: + case FOLDER_TYPE_BOOKMARK: + case FOLDER_TYPE_NORMAL: try { - const wxString& parentPath = parentData->getPath (); + const wxString& parentPath = parentData->getPath(); - Refresh (parentPath, parentId); + Refresh(parentPath, parentId); } catch (svn::ClientException & e) { - wxString errtxt (Utf8ToLocal (e.message ())); + wxString errtxt(Utf8ToLocal(e.message())); wxLogError(_("Error while refreshing filelist (%s)"), - errtxt.c_str ()); + errtxt.c_str()); } break; } - treeCtrl->SortChildren (parentId); + treeCtrl->SortChildren(parentId); } void - OnCollapseItem (wxTreeEvent & event) + OnCollapseItem(wxTreeEvent & event) { - wxTreeItemId parentId = event.GetItem (); + wxTreeItemId parentId = event.GetItem(); wxTreeItemIdValue cookie; - wxTreeItemId id = treeCtrl->GetFirstChild (parentId, cookie); + wxTreeItemId id = treeCtrl->GetFirstChild(parentId, cookie); - while(id.IsOk()) + while (id.IsOk()) { - Delete (id); - id=treeCtrl->GetFirstChild (parentId, cookie); + Delete(id); + id=treeCtrl->GetFirstChild(parentId, cookie); } - treeCtrl->SetItemHasChildren (parentId, TRUE); + treeCtrl->SetItemHasChildren(parentId, TRUE); } void - Refresh (const wxString & parentPath, - const wxTreeItemId & parentId) + Refresh(const wxString & parentPath, + const wxTreeItemId & parentId) { - // If the parent is already expanded, + // If the parent is already expanded, // nothing has to be done here - if (treeCtrl->IsExpanded (parentId)) + if (treeCtrl->IsExpanded(parentId)) return; - svn::Client client (GetContext ()); - svn::Path parentPathUtf8 (PathUtf8 (parentPath)); + svn::Client client(GetContext()); + svn::Path parentPathUtf8(PathUtf8(parentPath)); // Get status array for parent and all entries within it - svn::StatusEntries entries = - client.status (parentPathUtf8.c_str (), - false, // Not recursive - true, // Get all entries - false, // Dont update from repository - false); // Use global ignores + svn::StatusEntries entries = + client.status(parentPathUtf8.c_str(), + false, // Not recursive + true, // Get all entries + false, // Dont update from repository + false); // Use global ignores svn::StatusEntries::iterator it; - for (it = entries.begin (); it != entries.end (); it++) + for (it = entries.begin(); it != entries.end(); it++) { svn::Status& status = *it; // Convert path from UTF8 to Local - svn::Path filename (status.path ()); - wxString path (Utf8ToLocal (filename.native ())); + svn::Path filename(status.path()); + wxString path(Utf8ToLocal(filename.native())); // Only display versioned directories - if ((status.entry ().kind () != svn_node_dir) && - (status.textStatus () != svn_wc_status_external)) + if ((status.entry().kind() != svn_node_dir) && + (status.textStatus() != svn_wc_status_external)) continue; - + if (parentPath == path) { // we update the information about the parent on // every occassion - FolderItemData * data = GetItemData (parentId); + FolderItemData * data = GetItemData(parentId); if (0 != data) - data->setStatus (status); + data->setStatus(status); } else { int image = FOLDER_IMAGE_FOLDER; int open_image = FOLDER_IMAGE_OPEN_FOLDER; - if (status.textStatus () == svn_wc_status_external) + if (status.textStatus() == svn_wc_status_external) { image = FOLDER_IMAGE_EXTERNALS_FOLDER; open_image = FOLDER_IMAGE_OPEN_EXTERNALS_FOLDER; @@ -579,29 +579,29 @@ struct FolderBrowser::Data } - if ((status.textStatus () == svn_wc_status_modified) || - (status.propStatus () == svn_wc_status_modified)) + if ((status.textStatus() == svn_wc_status_modified) || + (status.propStatus() == svn_wc_status_modified)) { image = FOLDER_IMAGE_MODIFIED_FOLDER; open_image = FOLDER_IMAGE_MODIFIED_OPEN_FOLDER; } - FolderItemData * data = new FolderItemData ( - FOLDER_TYPE_NORMAL, path, - Utf8ToLocal (filename.basename ()), + FolderItemData * data = new FolderItemData( + FOLDER_TYPE_NORMAL, path, + Utf8ToLocal(filename.basename()), TRUE); - data->setStatus (status); + data->setStatus(status); wxTreeItemId newId = treeCtrl->AppendItem( - parentId, - Utf8ToLocal (filename.basename ()), - image, image, data); + parentId, + Utf8ToLocal(filename.basename()), + image, image, data); bool hasSubDirs = true; - if (!filename.isUrl ()) - hasSubDirs = HasSubdirectories (path); - treeCtrl->SetItemHasChildren (newId, hasSubDirs); - treeCtrl->SetItemImage (newId, open_image, wxTreeItemIcon_Expanded); + if (!filename.isUrl()) + hasSubDirs = HasSubdirectories(path); + treeCtrl->SetItemHasChildren(newId, hasSubDirs); + treeCtrl->SetItemImage(newId, open_image, wxTreeItemIcon_Expanded); } } } @@ -611,24 +611,24 @@ struct FolderBrowser::Data * Finds the child entry with @a path */ wxTreeItemId - FindClosestChild (const wxTreeItemId & parentId, const wxString & path) + FindClosestChild(const wxTreeItemId & parentId, const wxString & path) { wxTreeItemIdValue cookie; - wxTreeItemId id = treeCtrl->GetFirstChild (parentId, cookie); + wxTreeItemId id = treeCtrl->GetFirstChild(parentId, cookie); wxTreeItemId childId; do { - const FolderItemData * data = GetItemData (id); + const FolderItemData * data = GetItemData(id); if (data == 0) break; - if (!data->isReal ()) + if (!data->isReal()) break; - const wxString nodePath (data->getPath ()); - if (nodePath.length () == 0) + const wxString nodePath(data->getPath()); + if (nodePath.length() == 0) break; // first check: full match? @@ -639,17 +639,17 @@ struct FolderBrowser::Data } // second check: match until path delimiter - wxString prefix (path.Left (nodePath.length ())); - wxString sep (path.Mid (nodePath.length (), 1)); + wxString prefix(path.Left(nodePath.length())); + wxString sep(path.Mid(nodePath.length(), 1)); - if ((prefix == nodePath) && IsValidSeparator (sep)) + if ((prefix == nodePath) && IsValidSeparator(sep)) { childId = id; break; } - id = treeCtrl->GetNextChild (parentId, cookie); - } while (id.IsOk ()); + id = treeCtrl->GetNextChild(parentId, cookie); + } while (id.IsOk()); return childId; } @@ -668,18 +668,18 @@ struct FolderBrowser::Data * @retval true selection successful */ bool - SelectFolder (const wxString & pathP) + SelectFolder(const wxString & pathP) { - if (pathP.Length () == 0) + if (pathP.Length() == 0) { - treeCtrl->SelectItem (treeCtrl->GetRootItem ()); + treeCtrl->SelectItem(treeCtrl->GetRootItem()); return true; } - wxTreeItemId bookmarkId = GetSelectedBookmarkId (); + wxTreeItemId bookmarkId = GetSelectedBookmarkId(); // found a valid bookmark? otherwise quit - if (!bookmarkId.IsOk ()) + if (!bookmarkId.IsOk()) return false; // begin searching in the folder hierarchy @@ -688,7 +688,7 @@ struct FolderBrowser::Data do { - const FolderItemData * data = GetItemData (id); + const FolderItemData * data = GetItemData(id); // first some validity checkings: // - there has to be a valid @a data item @@ -699,11 +699,11 @@ struct FolderBrowser::Data if (data == 0) break; - if (!data->isReal ()) + if (!data->isReal()) break; - const wxString nodePath (data->getPath ()); - if (nodePath.length () == 0) + const wxString nodePath(data->getPath()); + if (nodePath.length() == 0) break; // check if @a path and @a nodePath match already @@ -715,31 +715,31 @@ struct FolderBrowser::Data } - wxString prefix (pathP.Left (nodePath.length())); - wxString sep (pathP.Mid (nodePath.length(), 1)); + wxString prefix(pathP.Left(nodePath.length())); + wxString sep(pathP.Mid(nodePath.length(), 1)); - if ((prefix != nodePath) || !IsValidSeparator (sep)) - break; + if ((prefix != nodePath) || !IsValidSeparator(sep)) + break; - if (!data->hasChildren ()) + if (!data->hasChildren()) break; // try to find @a path in one of the children // make sure node is open - if (!treeCtrl->IsExpanded (id)) - treeCtrl->Expand (id); + if (!treeCtrl->IsExpanded(id)) + treeCtrl->Expand(id); - id = FindClosestChild (id, pathP); - } while (id.IsOk ()); + id = FindClosestChild(id, pathP); + } while (id.IsOk()); if (success) - treeCtrl->SelectItem (id); + treeCtrl->SelectItem(id); return success; } FolderItemData * - GetItemData (const wxTreeItemId & id) const + GetItemData(const wxTreeItemId & id) const { if (!treeCtrl) return 0; @@ -747,19 +747,19 @@ struct FolderBrowser::Data if (!id) return 0; - return static_cast(treeCtrl->GetItemData (id)); + return static_cast(treeCtrl->GetItemData(id)); } bool - SelectBookmark (const wxString & bookmarkPath) + SelectBookmark(const wxString & bookmarkPath) { wxTreeItemIdValue cookie; - wxTreeItemId id = treeCtrl->GetFirstChild (rootId, cookie); + wxTreeItemId id = treeCtrl->GetFirstChild(rootId, cookie); bool success = false; while (!success) { - FolderItemData * data = GetItemData (id); + FolderItemData * data = GetItemData(id); // if id is not valid, data will be 0 // This is the case if there are no @@ -769,19 +769,19 @@ struct FolderBrowser::Data // bookmark match? #ifdef __WXMSW__ - if (data->getPath ().Lower () == bookmarkPath.Lower ()) + if (data->getPath().Lower() == bookmarkPath.Lower()) #else - if (data->getPath () == bookmarkPath) + if (data->getPath() == bookmarkPath) #endif { // select bookmark success = true; - treeCtrl->SelectItem (id); + treeCtrl->SelectItem(id); } else { // otherwise move to next - id = treeCtrl->GetNextChild (rootId, cookie); + id = treeCtrl->GetNextChild(rootId, cookie); } } return success; @@ -794,74 +794,74 @@ struct FolderBrowser::Data * @return id of bookmark for selected node */ wxTreeItemId - GetSelectedBookmarkId () const + GetSelectedBookmarkId() const { - wxTreeItemId id = treeCtrl->GetSelection (); + wxTreeItemId id = treeCtrl->GetSelection(); const FolderItemData * data; wxTreeItemId bookmarkId; - while (id.IsOk ()) + while (id.IsOk()) { - data = GetItemData (id); + data = GetItemData(id); if (data == 0) break; - if (data->getFolderType () == FOLDER_TYPE_BOOKMARK) + if (data->getFolderType() == FOLDER_TYPE_BOOKMARK) { bookmarkId = id; break; } // step up one level - id = treeCtrl->GetItemParent (id); + id = treeCtrl->GetItemParent(id); } return bookmarkId; } - const wxString & - GetSelectedBookmarkPath () const + const wxString & + GetSelectedBookmarkPath() const { - wxTreeItemId id = GetSelectedBookmarkId (); + wxTreeItemId id = GetSelectedBookmarkId(); - if (!id.IsOk ()) + if (!id.IsOk()) return EmptyString; - FolderItemData * data = GetItemData (id); + FolderItemData * data = GetItemData(id); - wxASSERT (data); + wxASSERT(data); - return data->getPath (); + return data->getPath(); } Bookmark & - GetSelectedBookmark () + GetSelectedBookmark() { - const wxString & path = GetSelectedBookmarkPath (); + const wxString & path = GetSelectedBookmarkPath(); // empty string means there isnt a bookmark // for the selecttion, e.g. the root of the tree - if (path.Length () == 0) + if (path.Length() == 0) return InvalidBookmark; // check whether we can find the bookmark - BookmarkHashMap::iterator it = bookmarks.find (path); + BookmarkHashMap::iterator it = bookmarks.find(path); - if (it == bookmarks.end ()) + if (it == bookmarks.end()) return InvalidBookmark; return it->second; } void - SetAuthPerBookmark (const bool perBookmark) + SetAuthPerBookmark(const bool perBookmark) { if (!perBookmark) { // one Context for all - ClearContexts (); - singleContext = CreateContext (); + ClearContexts(); + singleContext = CreateContext(); } else { @@ -871,266 +871,266 @@ struct FolderBrowser::Data singleContext = 0; } - BookmarkHashMap::iterator it = bookmarks.begin (); + BookmarkHashMap::iterator it = bookmarks.begin(); - for (; it!=bookmarks.end (); it++) + for (; it!=bookmarks.end(); it++) { - it->second.context = CreateContext (); + it->second.context = CreateContext(); } } } const bool - GetAuthPerBookmark () const + GetAuthPerBookmark() const { return singleContext == 0; } - void ClearContexts () + void ClearContexts() { - BookmarkHashMap::iterator it = bookmarks.begin (); + BookmarkHashMap::iterator it = bookmarks.begin(); - for (; it!=bookmarks.end (); it++) - it->second.ClearContext (); + for (; it!=bookmarks.end(); it++) + it->second.ClearContext(); } - void SetAuthCache (bool value) + void SetAuthCache(bool value) { useAuthCache = value; // make sure the already existing contexts // are using the new setting - defaultContext.setAuthCache (value); + defaultContext.setAuthCache(value); if (singleContext != 0) - singleContext->setAuthCache (value); + singleContext->setAuthCache(value); - BookmarkHashMap::iterator it = bookmarks.begin (); + BookmarkHashMap::iterator it = bookmarks.begin(); - for (; it!= bookmarks.end (); it++) - it->second.SetAuthCache (value); + for (; it!= bookmarks.end(); it++) + it->second.SetAuthCache(value); } }; -BEGIN_EVENT_TABLE (FolderBrowser, wxTreeCtrl) - EVT_TREE_ITEM_EXPANDING (-1, FolderBrowser::OnExpandItem) - EVT_TREE_ITEM_COLLAPSED (-1, FolderBrowser::OnCollapseItem) - EVT_TREE_KEY_DOWN (-1, FolderBrowser::OnTreeKeyDown) - EVT_CONTEXT_MENU (FolderBrowser::OnContextMenu) - EVT_TREE_BEGIN_DRAG (-1, FolderBrowser::OnBeginDrag) - EVT_SET_FOCUS (FolderBrowser::OnSetFocus) -END_EVENT_TABLE () - -FolderBrowser::FolderBrowser (wxWindow * parent, const wxWindowID id, - const wxPoint & pos, const wxSize & size, - const wxString & name) - : wxTreeCtrl (parent, id, pos, size, wxTR_HAS_BUTTONS | wxTR_SINGLE, wxDefaultValidator, name) +BEGIN_EVENT_TABLE(FolderBrowser, wxTreeCtrl) + EVT_TREE_ITEM_EXPANDING(-1, FolderBrowser::OnExpandItem) + EVT_TREE_ITEM_COLLAPSED(-1, FolderBrowser::OnCollapseItem) + EVT_TREE_KEY_DOWN(-1, FolderBrowser::OnTreeKeyDown) + EVT_CONTEXT_MENU(FolderBrowser::OnContextMenu) + EVT_TREE_BEGIN_DRAG(-1, FolderBrowser::OnBeginDrag) + EVT_SET_FOCUS(FolderBrowser::OnSetFocus) +END_EVENT_TABLE() + +FolderBrowser::FolderBrowser(wxWindow * parent, const wxWindowID id, + const wxPoint & pos, const wxSize & size, + const wxString & name) + : wxTreeCtrl(parent, id, pos, size, wxTR_HAS_BUTTONS | wxTR_SINGLE, wxDefaultValidator, name) { - m = new Data (this); + m = new Data(this); } -FolderBrowser::~FolderBrowser () +FolderBrowser::~FolderBrowser() { delete m; } void -FolderBrowser::RefreshFolderBrowser () +FolderBrowser::RefreshFolderBrowser() { // remember selected - wxString bookmarkPath = m->GetSelectedBookmarkPath (); - wxString path = m->GetPath (); + wxString bookmarkPath = m->GetSelectedBookmarkPath(); + wxString path = m->GetPath(); // refresh contents - m->treeCtrl->Collapse (m->rootId); - m->treeCtrl->Expand (m->rootId); + m->treeCtrl->Collapse(m->rootId); + m->treeCtrl->Expand(m->rootId); // now try to find the remembered selection - if (bookmarkPath.Length () == 0) + if (bookmarkPath.Length() == 0) return; - if(!m->SelectBookmark (bookmarkPath)) + if (!m->SelectBookmark(bookmarkPath)) return; - wxTreeItemId bookmarkId = m->treeCtrl->GetSelection (); - if (m->treeCtrl->ItemHasChildren (bookmarkId)) - m->treeCtrl->Expand (bookmarkId); + wxTreeItemId bookmarkId = m->treeCtrl->GetSelection(); + if (m->treeCtrl->ItemHasChildren(bookmarkId)) + m->treeCtrl->Expand(bookmarkId); - SelectFolder (path); + SelectFolder(path); } const bool -FolderBrowser::RemoveBookmark () +FolderBrowser::RemoveBookmark() { - wxTreeItemId id = m->treeCtrl->GetSelection (); + wxTreeItemId id = m->treeCtrl->GetSelection(); - if(!id.IsOk ()) + if (!id.IsOk()) return false; - FolderItemData* data = (FolderItemData*) m->treeCtrl->GetItemData (id); + FolderItemData* data = (FolderItemData*) m->treeCtrl->GetItemData(id); - if (data->getFolderType () != FOLDER_TYPE_BOOKMARK) + if (data->getFolderType() != FOLDER_TYPE_BOOKMARK) return false; - SelectFolder (wxEmptyString); + SelectFolder(wxEmptyString); - wxString path = data->getPath (); - m->Delete (id); - m->bookmarks.erase (path); + wxString path = data->getPath(); + m->Delete(id); + m->bookmarks.erase(path); return true; } void -FolderBrowser::AddBookmark (const wxString & path) +FolderBrowser::AddBookmark(const wxString & path) { - m->AddBookmark (path, false); + m->AddBookmark(path, false); } const wxString -FolderBrowser::GetPath () const +FolderBrowser::GetPath() const { - return m->GetPath (); + return m->GetPath(); } const FolderItemData * -FolderBrowser::GetSelectedItemData () const +FolderBrowser::GetSelectedItemData() const { - return m->GetSelection (); + return m->GetSelection(); } const FolderItemData * -FolderBrowser::HitTest (const wxPoint & point) const +FolderBrowser::HitTest(const wxPoint & point) const { - return m->HitTest (point); + return m->HitTest(point); } void -FolderBrowser::OnTreeKeyDown (wxTreeEvent & event) +FolderBrowser::OnTreeKeyDown(wxTreeEvent & event) { - m->OnTreeKeyDown (event); + m->OnTreeKeyDown(event); } void -FolderBrowser::OnExpandItem (wxTreeEvent & event) +FolderBrowser::OnExpandItem(wxTreeEvent & event) { - m->OnExpandItem (event); + m->OnExpandItem(event); } void -FolderBrowser::OnCollapseItem (wxTreeEvent & event) +FolderBrowser::OnCollapseItem(wxTreeEvent & event) { - m->OnCollapseItem (event); + m->OnCollapseItem(event); } void -FolderBrowser::OnContextMenu (wxContextMenuEvent & event) +FolderBrowser::OnContextMenu(wxContextMenuEvent & event) { - wxPoint clientPt = ScreenToClient (event.GetPosition ()); - m->ShowMenu (clientPt); + wxPoint clientPt = ScreenToClient(event.GetPosition()); + m->ShowMenu(clientPt); } bool -FolderBrowser::SelectFolder (const wxString & path) +FolderBrowser::SelectFolder(const wxString & path) { - return m->SelectFolder (path); + return m->SelectFolder(path); } svn::Context * -FolderBrowser::GetContext () +FolderBrowser::GetContext() { - return m->GetContext (); + return m->GetContext(); } void -FolderBrowser::SetAuthPerBookmark (const bool value) +FolderBrowser::SetAuthPerBookmark(const bool value) { - m->SetAuthPerBookmark (value); + m->SetAuthPerBookmark(value); } const bool -FolderBrowser::GetAuthPerBookmark () const +FolderBrowser::GetAuthPerBookmark() const { - return m->GetAuthPerBookmark (); + return m->GetAuthPerBookmark(); } bool -FolderBrowser::SelectBookmark (const wxString & bookmarkPath) +FolderBrowser::SelectBookmark(const wxString & bookmarkPath) { - return m->SelectBookmark (bookmarkPath); + return m->SelectBookmark(bookmarkPath); } void -FolderBrowser::SetListener (svn::ContextListener * listener) +FolderBrowser::SetListener(svn::ContextListener * listener) { m->listener = listener; } svn::ContextListener * -FolderBrowser::GetListener () const +FolderBrowser::GetListener() const { return m->listener; } void -FolderBrowser::WriteConfig (wxConfigBase * cfg) const +FolderBrowser::WriteConfig(wxConfigBase * cfg) const { - wxASSERT (cfg); + wxASSERT(cfg); - cfg->Write (ConfigBookmarkCount, (long)m->bookmarks.size ()); + cfg->Write(ConfigBookmarkCount, (long)m->bookmarks.size()); // Save the bookmarks contents long item = 0; - BookmarkHashMap::iterator it = m->bookmarks.begin (); + BookmarkHashMap::iterator it = m->bookmarks.begin(); - for (; it != m->bookmarks.end (); it++) + for (; it != m->bookmarks.end(); it++) { wxString keyPath, keyFlatMode; - keyPath.Printf (ConfigBookmarkFmt, item); - keyFlatMode.Printf (ConfigFlatModeFmt, item); + keyPath.Printf(ConfigBookmarkFmt, item); + keyFlatMode.Printf(ConfigFlatModeFmt, item); - cfg->Write (keyPath, it->first); + cfg->Write(keyPath, it->first); if (it->second.flatMode) - cfg->Write (keyFlatMode, (long)1); + cfg->Write(keyFlatMode, (long)1); else - cfg->Write (keyFlatMode, (long)0); + cfg->Write(keyFlatMode, (long)0); item++; } } void -FolderBrowser::ReadConfig (wxConfigBase * cfg) +FolderBrowser::ReadConfig(wxConfigBase * cfg) { - wxASSERT (cfg); + wxASSERT(cfg); Preferences prefs; long item, count; - cfg->Read (ConfigBookmarkCount, &count, 0); + cfg->Read(ConfigBookmarkCount, &count, 0); for (item = 0; item < count; item++) { wxString keyPath, keyFlatMode; wxString path; - keyPath.Printf (ConfigBookmarkFmt, item); - keyFlatMode.Printf (ConfigFlatModeFmt, item); - cfg->Read (keyPath, &path, wxEmptyString); + keyPath.Printf(ConfigBookmarkFmt, item); + keyFlatMode.Printf(ConfigFlatModeFmt, item); + cfg->Read(keyPath, &path, wxEmptyString); long flatMode=0; if (!prefs.resetFlatModeOnStart) - cfg->Read (keyFlatMode, &flatMode, 0); + cfg->Read(keyFlatMode, &flatMode, 0); - if (path.Length () > 0) - m->bookmarks [path] = Bookmark (flatMode != 0); + if (path.Length() > 0) + m->bookmarks [path] = Bookmark(flatMode != 0); } } const bool -FolderBrowser::IsFlat () const +FolderBrowser::IsFlat() const { - Bookmark & bookmark = m->GetSelectedBookmark (); + Bookmark & bookmark = m->GetSelectedBookmark(); if (&bookmark == &InvalidBookmark) return false; @@ -1139,78 +1139,78 @@ FolderBrowser::IsFlat () const } bool -FolderBrowser::SetFlat (bool flatMode) +FolderBrowser::SetFlat(bool flatMode) { - Bookmark & bookmark = m->GetSelectedBookmark (); + Bookmark & bookmark = m->GetSelectedBookmark(); if (&bookmark == &InvalidBookmark) return false; bookmark.flatMode = flatMode; return true; -} - +} + const bool -FolderBrowser::GetAuthCache () const +FolderBrowser::GetAuthCache() const { return m->useAuthCache; } - + void -FolderBrowser::SetAuthCache (const bool value) +FolderBrowser::SetAuthCache(const bool value) { - m->SetAuthCache (value); + m->SetAuthCache(value); } void -FolderBrowser::ExpandSelection () +FolderBrowser::ExpandSelection() { if (!m->treeCtrl) return; - wxTreeItemId id (m->treeCtrl->GetSelection ()); + wxTreeItemId id(m->treeCtrl->GetSelection()); - if (!id.IsOk ()) + if (!id.IsOk()) return; - m->treeCtrl->Expand (id); + m->treeCtrl->Expand(id); } void -FolderBrowser::OnBeginDrag (wxTreeEvent & event) +FolderBrowser::OnBeginDrag(wxTreeEvent & event) { wxFileDataObject data; - const wxTreeItemId id = event.GetItem (); - if(!id.IsOk()) + const wxTreeItemId id = event.GetItem(); + if (!id.IsOk()) { - data.AddFile (GetPath ()); + data.AddFile(GetPath()); } else { - FolderItemData* itemData = m->GetItemData (id); - data.AddFile (itemData->getPath ()); + FolderItemData* itemData = m->GetItemData(id); + data.AddFile(itemData->getPath()); } - wxDropSource dropSource (this); - dropSource.SetData (data); - /** + wxDropSource dropSource(this); + dropSource.SetData(data); + /** * @todo we dont seem to need result * wxDragResult result = dropSource.DoDragDrop (true); */ - dropSource.DoDragDrop (true); + dropSource.DoDragDrop(true); } const svn::StatusSel & -FolderBrowser::GetStatusSel () const +FolderBrowser::GetStatusSel() const { - m->statusSel.clear (); + m->statusSel.clear(); - const FolderItemData * itemData = m->GetSelection (); + const FolderItemData * itemData = m->GetSelection(); if (itemData != 0) { - const svn::Status & status = itemData->getStatus (); - m->statusSel.push_back (status); + const svn::Status & status = itemData->getStatus(); + m->statusSel.push_back(status); } return m->statusSel; @@ -1218,11 +1218,11 @@ FolderBrowser::GetStatusSel () const void -FolderBrowser::OnSetFocus (wxFocusEvent & event) +FolderBrowser::OnSetFocus(wxFocusEvent & event) { // forward this event to the parent - wxCommandEvent newEvent (wxEVT_COMMAND_MENU_SELECTED, event.GetId ()); - wxPostEvent (GetParent (), newEvent); + wxCommandEvent newEvent(wxEVT_COMMAND_MENU_SELECTED, event.GetId()); + wxPostEvent(GetParent(), newEvent); // don't stop default process event.Skip(); diff --git a/src/folder_browser.hpp b/src/folder_browser.hpp index 192b9a4b..be47f39c 100644 --- a/src/folder_browser.hpp +++ b/src/folder_browser.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -42,37 +42,37 @@ namespace svn class FolderBrowser : public wxTreeCtrl { public: - FolderBrowser (wxWindow * parent, const wxWindowID id = -1, - const wxPoint & pos = wxDefaultPosition, - const wxSize & size = wxDefaultSize, - const wxString & name = wxT("FolderBrowser")); + FolderBrowser(wxWindow * parent, const wxWindowID id = -1, + const wxPoint & pos = wxDefaultPosition, + const wxSize & size = wxDefaultSize, + const wxString & name = wxT("FolderBrowser")); - virtual ~FolderBrowser (); + virtual ~FolderBrowser(); - void - RefreshFolderBrowser (); + void + RefreshFolderBrowser(); /** * remove the selected bookmark from bookmarks */ - const bool - RemoveBookmark (); + const bool + RemoveBookmark(); /** - * add bookmark. - * + * add bookmark. + * * @param path path/url of the bookmark */ - void - AddBookmark (const wxString & path); + void + AddBookmark(const wxString & path); /** * returns the path of the current selection * if nothing is selected, an empty string * is returned */ - const wxString - GetPath () const; + const wxString + GetPath() const; /** * returns the "context" of the current selection. @@ -80,14 +80,14 @@ class FolderBrowser : public wxTreeCtrl * * @return context of selection */ - const FolderItemData * - GetSelectedItemData () const; + const FolderItemData * + GetSelectedItemData() const; - /** + /** * the selected @ref Status instances */ const svn::StatusSel & - GetStatusSel () const; + GetStatusSel() const; /** * returns the "context" of the item at point. @@ -95,8 +95,8 @@ class FolderBrowser : public wxTreeCtrl * * @return context of selection */ - const FolderItemData * - HitTest (const wxPoint & point) const; + const FolderItemData * + HitTest(const wxPoint & point) const; /** * return the authentication context of the current selection @@ -104,8 +104,8 @@ class FolderBrowser : public wxTreeCtrl * @return authentication context * @retval NULL if Bookmarks is selected */ - svn::Context * - GetContext (); + svn::Context * + GetContext(); /** * Tries to select @a path in the current selected bookmark. @@ -121,7 +121,7 @@ class FolderBrowser : public wxTreeCtrl * @retval true selection successful */ bool - SelectFolder (const wxString & path); + SelectFolder(const wxString & path); /** * selects the @a bookmark @@ -130,7 +130,7 @@ class FolderBrowser : public wxTreeCtrl * @return true on success */ bool - SelectBookmark (const wxString & bookmarkPath); + SelectBookmark(const wxString & bookmarkPath); /** * setting whether there will be one login for all the @@ -139,19 +139,19 @@ class FolderBrowser : public wxTreeCtrl * each bookmark in the bookmarks list remembers its own login */ void - SetAuthPerBookmark (const bool value); + SetAuthPerBookmark(const bool value); - /** - * check whether flat-mode is turned on for the + /** + * check whether flat-mode is turned on for the * selected bookmark * * @retval true flat-mode is turned on */ const bool - IsFlat () const; + IsFlat() const; /** - * turns flat-mode for the selected bookmark + * turns flat-mode for the selected bookmark * on or off * * @param flatMode true=on @@ -159,31 +159,31 @@ class FolderBrowser : public wxTreeCtrl * @retval false not set, e.g. root selected or nothing */ bool - SetFlat (bool flatMode); + SetFlat(bool flatMode); /** * @return auth per bookmark setting */ const bool - GetAuthPerBookmark () const; + GetAuthPerBookmark() const; /** * check if authentication credentials should be cached or not */ const bool - GetAuthCache () const; + GetAuthCache() const; /** * select if authentication credentials should be cached or not */ void - SetAuthCache (const bool value); + SetAuthCache(const bool value); void - SetListener (svn::ContextListener * listener); + SetListener(svn::ContextListener * listener); svn::ContextListener * - GetListener () const; + GetListener() const; /** * Writes configuration including bookmarks @@ -192,7 +192,7 @@ class FolderBrowser : public wxTreeCtrl * @param cfg Config instance to write to */ void - WriteConfig (wxConfigBase * cfg) const; + WriteConfig(wxConfigBase * cfg) const; /** * Read configuration @@ -200,7 +200,7 @@ class FolderBrowser : public wxTreeCtrl * @param cfg Config instance */ void - ReadConfig (wxConfigBase * cfg); + ReadConfig(wxConfigBase * cfg); /** * Expand the selected leaf of the tree. @@ -208,7 +208,7 @@ class FolderBrowser : public wxTreeCtrl * leafs */ void - ExpandSelection (); + ExpandSelection(); private: struct Data; @@ -217,12 +217,12 @@ class FolderBrowser : public wxTreeCtrl /** * disallow default constructor */ - FolderBrowser (); + FolderBrowser(); /** * disallow copy constructor */ - FolderBrowser (const FolderBrowser &); + FolderBrowser(const FolderBrowser &); /** * disallow assignment operator @@ -230,14 +230,14 @@ class FolderBrowser : public wxTreeCtrl FolderBrowser & operator = (const FolderBrowser &); private: - DECLARE_EVENT_TABLE () - - void OnTreeKeyDown (wxTreeEvent & event); - void OnExpandItem (wxTreeEvent & event); - void OnCollapseItem (wxTreeEvent & event); - void OnContextMenu (wxContextMenuEvent & event); - void OnBeginDrag (wxTreeEvent & event); - void OnSetFocus (wxFocusEvent & event); + DECLARE_EVENT_TABLE() + + void OnTreeKeyDown(wxTreeEvent & event); + void OnExpandItem(wxTreeEvent & event); + void OnCollapseItem(wxTreeEvent & event); + void OnContextMenu(wxContextMenuEvent & event); + void OnBeginDrag(wxTreeEvent & event); + void OnSetFocus(wxFocusEvent & event); }; #endif diff --git a/src/folder_browser_drop_target.cpp b/src/folder_browser_drop_target.cpp index 8742a876..4984c884 100644 --- a/src/folder_browser_drop_target.cpp +++ b/src/folder_browser_drop_target.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -27,19 +27,19 @@ #include "folder_browser.hpp" #include "folder_item_data.hpp" -FolderBrowserDropTarget::FolderBrowserDropTarget (FolderBrowser * parent) - : m_parent (parent) +FolderBrowserDropTarget::FolderBrowserDropTarget(FolderBrowser * parent) + : m_parent(parent) { } wxString -FolderBrowserDropTarget::GetDestinationPath (const wxPoint & point) +FolderBrowserDropTarget::GetDestinationPath(const wxPoint & point) { wxString path = wxEmptyString; - const FolderItemData * folderData = m_parent->HitTest (point); + const FolderItemData * folderData = m_parent->HitTest(point); if (folderData != NULL) { - path = folderData->getPath (); + path = folderData->getPath(); } return path; diff --git a/src/folder_browser_drop_target.hpp b/src/folder_browser_drop_target.hpp index aa5eab04..d6b3aad3 100644 --- a/src/folder_browser_drop_target.hpp +++ b/src/folder_browser_drop_target.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -32,10 +32,10 @@ class FolderBrowser; class FolderBrowserDropTarget : public RapidSvnDropTarget { public: - FolderBrowserDropTarget (FolderBrowser * parent); + FolderBrowserDropTarget(FolderBrowser * parent); - virtual wxString - GetDestinationPath (const wxPoint & point); + virtual wxString + GetDestinationPath(const wxPoint & point); private: FolderBrowser * m_parent; diff --git a/src/folder_item_data.cpp b/src/folder_item_data.cpp index 303836ac..2d27367a 100644 --- a/src/folder_item_data.cpp +++ b/src/folder_item_data.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -31,35 +31,35 @@ // app #include "folder_item_data.hpp" -FolderItemData::FolderItemData (const int folderType, - const wxString & path, - const wxString & name, - bool hasChildren) - : wxTreeItemData () +FolderItemData::FolderItemData(const int folderType, + const wxString & path, + const wxString & name, + bool hasChildren) + : wxTreeItemData() { - Create (folderType, path, name, hasChildren); + Create(folderType, path, name, hasChildren); } -FolderItemData::FolderItemData () - : wxTreeItemData () +FolderItemData::FolderItemData() + : wxTreeItemData() { } -FolderItemData::FolderItemData (const FolderItemData& src) - : wxTreeItemData () +FolderItemData::FolderItemData(const FolderItemData& src) + : wxTreeItemData() { - Create (src.m_folderType, src.m_path, src.m_name, src.m_hasChildren); + Create(src.m_folderType, src.m_path, src.m_name, src.m_hasChildren); } -FolderItemData::~FolderItemData () +FolderItemData::~FolderItemData() { } void -FolderItemData::Create (const int folderType, - const wxString & path, - const wxString & name, - bool hasChildren) +FolderItemData::Create(const int folderType, + const wxString & path, + const wxString & name, + bool hasChildren) { m_folderType = folderType; m_path = path; @@ -67,7 +67,7 @@ FolderItemData::Create (const int folderType, m_hasChildren = hasChildren; } - + /* ----------------------------------------------------------------- * local variables: * eval: (load-file "../rapidsvn-dev.el") diff --git a/src/folder_item_data.hpp b/src/folder_item_data.hpp index a03d00da..7d7400c1 100644 --- a/src/folder_item_data.hpp +++ b/src/folder_item_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -57,47 +57,47 @@ class FolderItemData : public wxTreeItemData /** * default constructor */ - FolderItemData (); + FolderItemData(); /** * copy constructor */ - FolderItemData (const FolderItemData& src); + FolderItemData(const FolderItemData& src); /** * destructor */ - virtual ~FolderItemData (); + virtual ~FolderItemData(); /** * initialize the member variables */ void - Create (const int folderType, - const wxString & path = wxEmptyString, - const wxString & name = wxEmptyString, - bool hasChildren = false); + Create(const int folderType, + const wxString & path = wxEmptyString, + const wxString & name = wxEmptyString, + bool hasChildren = false); const int - getFolderType () const + getFolderType() const { return m_folderType; } const wxString& - getPath () const + getPath() const { return m_path; } const wxString& - getName () const + getName() const { return m_name; } const bool - hasChildren () const + hasChildren() const { return m_hasChildren; } @@ -109,7 +109,7 @@ class FolderItemData : public wxTreeItemData * @retval true existing folder * @retval false unreal/virtual entry */ - const bool isReal () const + const bool isReal() const { switch (m_folderType) { @@ -123,13 +123,13 @@ class FolderItemData : public wxTreeItemData } const svn::Status & - getStatus () const + getStatus() const { return m_status; } void - setStatus (const svn::Status & status) + setStatus(const svn::Status & status) { m_status = status; } diff --git a/src/get_action.cpp b/src/get_action.cpp index bc397b6c..05a3f702 100644 --- a/src/get_action.cpp +++ b/src/get_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,38 +34,38 @@ #include "get_action.hpp" #include "utils.hpp" -GetAction::GetAction (wxWindow * parent, const GetData & data) - : Action (parent, _("Update")), - m_data (data) +GetAction::GetAction(wxWindow * parent, const GetData & data) + : Action(parent, _("Update")), + m_data(data) { } bool -GetAction::Prepare () +GetAction::Prepare() { return true; } bool -GetAction::Perform () +GetAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); wxString msg; - msg.Printf (wxT("Getting: %s, Revision %d"), m_data.path.c_str(), - m_data.revision.revnum()); + msg.Printf(wxT("Getting: %s, Revision %d"), m_data.path.c_str(), + m_data.revision.revnum()); Trace(msg); - wxSetWorkingDirectory (Utf8ToLocal (GetPath ().c_str ())); - client.update (svn::Path (LocalToUtf8 (m_data.path)), - m_data.revision, - true, false); + wxSetWorkingDirectory(Utf8ToLocal(GetPath().c_str())); + client.update(svn::Path(LocalToUtf8(m_data.path)), + m_data.revision, + true, false); return true; } bool -GetAction::CheckStatusSel (const svn::StatusSel & statusSel) +GetAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/get_action.hpp b/src/get_action.hpp index 393d8ac5..e0ad77df 100644 --- a/src/get_action.hpp +++ b/src/get_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -38,8 +38,8 @@ namespace svn * This class works very much like UpdateAction. * There are differences: * - there wont be any dialogs shown - * - the action ignores "targets" - * - works only on a single path that is + * - the action ignores "targets" + * - works only on a single path that is * pass in the @a GetData structure */ class GetAction:public Action @@ -54,16 +54,16 @@ class GetAction:public Action * @param parent parent window * @param data update data */ - GetAction (wxWindow * parent, const GetData & data); + GetAction(wxWindow * parent, const GetData & data); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: GetData m_data; diff --git a/src/get_data.hpp b/src/get_data.hpp index f3be0566..eebde682 100644 --- a/src/get_data.hpp +++ b/src/get_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/src/hist_entries.cpp b/src/hist_entries.cpp index a3e123d5..12bb9641 100644 --- a/src/hist_entries.cpp +++ b/src/hist_entries.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/src/hist_entries.hpp b/src/hist_entries.hpp index 08059003..88280f7f 100644 --- a/src/hist_entries.hpp +++ b/src/hist_entries.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/src/hist_mgr.cpp b/src/hist_mgr.cpp index 91a12a11..79ba1ebc 100644 --- a/src/hist_mgr.cpp +++ b/src/hist_mgr.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,7 +35,7 @@ /** a hash map that contains wxArrayString */ -WX_DECLARE_STRING_HASH_MAP (wxArrayString, wxArrayStringHashMap); +WX_DECLARE_STRING_HASH_MAP(wxArrayString, wxArrayStringHashMap); /** maximal number of entries per list */ @@ -53,14 +53,14 @@ HistoryManager TheHistoryManager; /** - * structure that hides implementation details from + * structure that hides implementation details from * hist_mgr.hpp */ struct HistoryManager::Data { public: - /** - * this flag signalizes all data has been + /** + * this flag signalizes all data has been * written to the disk. */ bool clean; @@ -68,38 +68,38 @@ struct HistoryManager::Data /** default constructor; nothing to initialize */ - Data () - : clean (true) + Data() + : clean(true) { } - /** + /** * destructor: there will be an assertion if * not all data has been written to the disk! */ - ~Data () + ~Data() { - wxASSERT_MSG (clean, wxT("HistoryManager: not all data has been written")); + wxASSERT_MSG(clean, wxT("HistoryManager: not all data has been written")); } /** - * checks whether the list named @a name exists - * and returns its value. If this doesnt + * checks whether the list named @a name exists + * and returns its value. If this doesnt * exist, create a new empty list * * @param name name of the list * @return list of strings */ const wxArrayString & - ReadList (const wxString & name) + ReadList(const wxString & name) { // is the list already in the memory? - if (FindList (name)) + if (FindList(name)) return lists [name]; // yeah! else - return ReadSingleList (name); // no! read it from config. + return ReadSingleList(name); // no! read it from config. } @@ -110,12 +110,12 @@ struct HistoryManager::Data * @retval true list is there */ bool - FindList (const wxString & name) + FindList(const wxString & name) { - wxArrayStringHashMap::iterator it = lists.find (name); + wxArrayStringHashMap::iterator it = lists.find(name); // is the list already in the memory? - if (it != lists.end ()) + if (it != lists.end()) return true; else return false; @@ -130,7 +130,7 @@ struct HistoryManager::Data * @param list list of strings */ void - WriteList (const wxString & name, const wxArrayString & list) + WriteList(const wxString & name, const wxArrayString & list) { lists [name] = list; } @@ -138,10 +138,10 @@ struct HistoryManager::Data /** * Adds a new entry to the list @a name. If the - * list doesnt exist it will be created. + * list doesnt exist it will be created. * * If the entry doesnt exist it will be insert at the - * first position in the array. + * first position in the array. * * If the entry already exists it will be deleted from * the old position and insert to the first position @@ -150,27 +150,27 @@ struct HistoryManager::Data * @param name name of the list * @param entry entry to add */ - void AddEntryToList (const wxString & name, - const wxString & entry) + void AddEntryToList(const wxString & name, + const wxString & entry) { // if list doesnt exist, read it - if (!FindList (name)) - ReadSingleList (name); + if (!FindList(name)) + ReadSingleList(name); wxArrayString & list = lists [name]; // try to find the entry - int i = list.Index (entry); + int i = list.Index(entry); if (i != wxNOT_FOUND) #if wxCHECK_VERSION(2, 6, 0) - list.RemoveAt (i); + list.RemoveAt(i); #else - list.Remove (i); + list.Remove(i); #endif // insert the string at the first position - list.Insert (entry, 0); + list.Insert(entry, 0); clean = false; } @@ -183,17 +183,17 @@ struct HistoryManager::Data * @see WriteSingleList */ void - WriteAllLists () + WriteAllLists() { wxArrayStringHashMap::iterator it; // cycle through all the lists - for (it = lists.begin (); it != lists.end (); it++) + for (it = lists.begin(); it != lists.end(); it++) { - wxString name (it->first); - wxArrayString list (it->second); + wxString name(it->first); + wxArrayString list(it->second); - WriteSingleList (name, list); + WriteSingleList(name, list); } clean = true; @@ -210,32 +210,32 @@ struct HistoryManager::Data * @param list list with entries */ void - WriteSingleList (const wxString & name, const wxArrayString & list) + WriteSingleList(const wxString & name, const wxArrayString & list) { // allow only maximal number - long count = list.Count (); - + long count = list.Count(); + if (count > MAX_COUNT) count = MAX_COUNT; // first write 0, only if everything goes smooth // we wanna write the real value - wxConfigBase * cfg = wxConfigBase::Get (); + wxConfigBase * cfg = wxConfigBase::Get(); wxString countStr; - countStr.Printf(CONF_COUNT_FMT, name.c_str ()); - cfg->Write (countStr, 0); + countStr.Printf(CONF_COUNT_FMT, name.c_str()); + cfg->Write(countStr, 0); long index; for (index = 0; index < count; index++) { wxString valueStr; - valueStr.Printf (CONF_VALUE_FMT, name.c_str (), index); + valueStr.Printf(CONF_VALUE_FMT, name.c_str(), index); - cfg->Write (valueStr, list[index]); + cfg->Write(valueStr, list[index]); } // no write real number of entries - cfg->Write (countStr, count); + cfg->Write(countStr, count); } @@ -246,37 +246,37 @@ struct HistoryManager::Data * @return list of values */ wxArrayString & - ReadSingleList (const wxString & name) + ReadSingleList(const wxString & name) { wxArrayString & list = lists [name]; - list.Empty (); + list.Empty(); // retrieve number of entries in the stored list // and limit the number - wxConfigBase * cfg = wxConfigBase::Get (); + wxConfigBase * cfg = wxConfigBase::Get(); wxString countStr; - countStr.Printf(CONF_COUNT_FMT, name.c_str ()); + countStr.Printf(CONF_COUNT_FMT, name.c_str()); long count; - cfg->Read (countStr, &count, 0); + cfg->Read(countStr, &count, 0); if (count > MAX_COUNT) count = MAX_COUNT; // now read the list - list.Alloc (count); + list.Alloc(count); long index; for (index=0; indexRead (valueStr, &value); + cfg->Read(valueStr, &value); // trim it and append it to the list (only if non-empty) - value.Trim (); - if (value.Length () > 0) - list.Add (value); + value.Trim(); + if (value.Length() > 0) + list.Add(value); } clean = false; @@ -287,45 +287,45 @@ struct HistoryManager::Data }; -HistoryManager::HistoryManager () - : m (new Data ()) +HistoryManager::HistoryManager() + : m(new Data()) { } -HistoryManager::~HistoryManager () +HistoryManager::~HistoryManager() { delete m; } const wxArrayString & -HistoryManager::ReadList (const wxString & id) +HistoryManager::ReadList(const wxString & id) { - return m->ReadList (id); + return m->ReadList(id); } void -HistoryManager::WriteList (const wxString & id, - const wxArrayString & list) +HistoryManager::WriteList(const wxString & id, + const wxArrayString & list) { - m->WriteList (id, list); + m->WriteList(id, list); } void -HistoryManager::AddEntryToList (const wxString & id, - const wxString & entry) +HistoryManager::AddEntryToList(const wxString & id, + const wxString & entry) { - m->AddEntryToList (id, entry); + m->AddEntryToList(id, entry); } -void -HistoryManager::Cleanup () +void +HistoryManager::Cleanup() { - m->WriteAllLists (); + m->WriteAllLists(); } diff --git a/src/hist_mgr.hpp b/src/hist_mgr.hpp index 33431a83..b45dbfc7 100644 --- a/src/hist_mgr.hpp +++ b/src/hist_mgr.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -31,8 +31,8 @@ /** * This class manages lists of historical entries. Such a list * has an unique identifier and a list of strings associated to it. - * - * You can read them with @a ReadList and write them back with + * + * You can read them with @a ReadList and write them back with * @a WriteList. * */ @@ -40,14 +40,14 @@ class HistoryManager { public: /** Default constructor */ - HistoryManager (); + HistoryManager(); /** Destructor */ - virtual ~ HistoryManager (); + virtual ~ HistoryManager(); - /** + /** * Read a list of strings identified by @a id * from the configuration file and write the * results to @a list. @@ -58,20 +58,20 @@ class HistoryManager * @param id unique identier for the list * @return list of entries */ - const wxArrayString & - ReadList (const wxString & id); + const wxArrayString & + ReadList(const wxString & id); /** * Add an entry to an existing list. If the * list doesnt exist already a new one is created - * + * * @param id unique identifier for the list * @param entry string to add */ void - AddEntryToList (const wxString & id, - const wxString & entry); + AddEntryToList(const wxString & id, + const wxString & entry); /** @@ -82,8 +82,8 @@ class HistoryManager * @param list string list */ void - WriteList (const wxString & id, - const wxArrayString & list); + WriteList(const wxString & id, + const wxArrayString & list); /** @@ -91,7 +91,7 @@ class HistoryManager * written to the configuration files */ void - Cleanup (); + Cleanup(); private: @@ -100,7 +100,7 @@ class HistoryManager Data * m; /** disallow copy constructor */ - HistoryManager (const HistoryManager &); + HistoryManager(const HistoryManager &); /** disallow assignment operator */ diff --git a/src/hist_val.cpp b/src/hist_val.cpp index 0a9266fe..8f9b648b 100644 --- a/src/hist_val.cpp +++ b/src/hist_val.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,28 +36,28 @@ #include "utils.hpp" -IMPLEMENT_CLASS (HistoryValidator, wxValidator) +IMPLEMENT_CLASS(HistoryValidator, wxValidator) -HistoryValidator::HistoryValidator (const wxString & settingName, - wxString * value, - bool dontUpdate, - bool useMostRecent) - : wxValidator (), m_settingName (settingName), m_value (value), - m_dontUpdate (dontUpdate), m_useMostRecent (useMostRecent) +HistoryValidator::HistoryValidator(const wxString & settingName, + wxString * value, + bool dontUpdate, + bool useMostRecent) + : wxValidator(), m_settingName(settingName), m_value(value), + m_dontUpdate(dontUpdate), m_useMostRecent(useMostRecent) { } -HistoryValidator::HistoryValidator (const HistoryValidator & src) +HistoryValidator::HistoryValidator(const HistoryValidator & src) { - Copy (src); + Copy(src); } bool HistoryValidator::Copy(const HistoryValidator & val) { - wxValidator::Copy (val); + wxValidator::Copy(val); m_settingName = val.m_settingName; m_value = val.m_value; @@ -68,72 +68,72 @@ HistoryValidator::Copy(const HistoryValidator & val) } -bool +bool HistoryValidator::TransferToWindow() { if (!m_validatorWindow) return false; // retrieve the list of recent entries - const wxArrayString & list = TheHistoryManager.ReadList (m_settingName); + const wxArrayString & list = TheHistoryManager.ReadList(m_settingName); // if we have a wxComboBox fill the list of values // with the recent entries and set the first value - if (m_validatorWindow->IsKindOf (CLASSINFO (wxComboBox))) + if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox))) { wxComboBox * comboBox = (wxComboBox *)m_validatorWindow; // clear and fill the combobox - comboBox->Clear (); + comboBox->Clear(); - size_t count = list.Count (); + size_t count = list.Count(); size_t index; // insert an entry with file selected to checkout if (m_value != 0) { - if (m_value->Length () > 0) + if (m_value->Length() > 0) { - comboBox->Append (*m_value); + comboBox->Append(*m_value); } } for (index = 0; index < count; index++) { - wxString value (list.Item (index)); + wxString value(list.Item(index)); - comboBox->Append (value); + comboBox->Append(value); } if (!m_useMostRecent) - comboBox->SetValue (wxEmptyString); + comboBox->SetValue(wxEmptyString); else { if (m_value != 0) { - if (comboBox->FindString (*m_value) != wxNOT_FOUND) - comboBox->SetValue (*m_value); + if (comboBox->FindString(*m_value) != wxNOT_FOUND) + comboBox->SetValue(*m_value); } // if we have an entry, select it if ((count > 0)) - comboBox->SetSelection (0, 0); + comboBox->SetSelection(0, 0); } return true; } - else if (m_validatorWindow->IsKindOf (CLASSINFO (wxTextCtrl))) + else if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl))) { wxTextCtrl * textCtrl = (wxTextCtrl *)m_validatorWindow; - if ((list.Count () == 0) || !m_useMostRecent) - textCtrl->SetValue (wxT("")); + if ((list.Count() == 0) || !m_useMostRecent) + textCtrl->SetValue(wxT("")); else { - textCtrl->SetValue (list.Item (0)); + textCtrl->SetValue(list.Item(0)); // select all the text - textCtrl->SetSelection (-1, -1); + textCtrl->SetSelection(-1, -1); } return true; @@ -145,37 +145,37 @@ HistoryValidator::TransferToWindow() } -bool +bool HistoryValidator::TransferFromWindow() { if (!m_validatorWindow) return false; // if we have a wxComboBox we use the last value - if (m_validatorWindow->IsKindOf (CLASSINFO (wxComboBox))) + if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox))) { wxComboBox * comboBox = (wxComboBox *)m_validatorWindow; - wxString lastValue (comboBox->GetValue ()); - lastValue.Trim (); + wxString lastValue(comboBox->GetValue()); + lastValue.Trim(); - if (!m_dontUpdate && (lastValue.Length () > 0)) - TheHistoryManager.AddEntryToList (m_settingName, lastValue); + if (!m_dontUpdate && (lastValue.Length() > 0)) + TheHistoryManager.AddEntryToList(m_settingName, lastValue); if (m_value) *m_value = lastValue; return true; } - else if (m_validatorWindow->IsKindOf (CLASSINFO (wxTextCtrl))) + else if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl))) { wxTextCtrl * textCtrl = (wxTextCtrl *)m_validatorWindow; - wxString lastValue (textCtrl->GetValue ()); - lastValue.Trim (); + wxString lastValue(textCtrl->GetValue()); + lastValue.Trim(); - if (!m_dontUpdate && (lastValue.Length () > 0)) - TheHistoryManager.AddEntryToList (m_settingName, lastValue); + if (!m_dontUpdate && (lastValue.Length() > 0)) + TheHistoryManager.AddEntryToList(m_settingName, lastValue); if (m_value) *m_value = lastValue; diff --git a/src/hist_val.hpp b/src/hist_val.hpp index 9ffc63a5..fbc5a9af 100644 --- a/src/hist_val.hpp +++ b/src/hist_val.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -31,14 +31,14 @@ /** * Validator class, that supports a history, - * e.g. for a combo control a list of previously + * e.g. for a combo control a list of previously * entered values * * @see HistoryManager */ class HistoryValidator: public wxValidator { -DECLARE_CLASS(HistoryValidator) + DECLARE_CLASS(HistoryValidator) public: /** * @param settingName name of the setting in @@ -49,41 +49,45 @@ DECLARE_CLASS(HistoryValidator) * fill the control on initialization but * will not back-propagate the value */ - HistoryValidator (const wxString & settingName, - wxString * value = 0, - bool dontUpdate = false, - bool useMostRecent = true); + HistoryValidator(const wxString & settingName, + wxString * value = 0, + bool dontUpdate = false, + bool useMostRecent = true); /** create a clone of the instane */ virtual wxObject * - Clone() const { return new HistoryValidator (*this); } + Clone() const { + return new HistoryValidator(*this); + } /** create a copy of @a val */ - bool + bool Copy(const HistoryValidator & val); /* Called when the value in the window must be validated. * This function can pop up an error message. */ - virtual bool - Validate(wxWindow * ) { return TRUE; } + virtual bool + Validate(wxWindow *) { + return TRUE; + } /** Called to transfer data to the window */ - virtual bool + virtual bool TransferToWindow(); /** Called to transfer data to the window */ - virtual bool + virtual bool TransferFromWindow(); /** copy consturctor */ - HistoryValidator (const HistoryValidator & src); + HistoryValidator(const HistoryValidator & src); private: /** name of the setting to use for this validator */ @@ -100,7 +104,7 @@ DECLARE_CLASS(HistoryValidator) bool m_useMostRecent; - + /** disallow assignment operator */ HistoryValidator & operator = (const HistoryValidator &); }; diff --git a/src/ids.hpp b/src/ids.hpp index be5f0ee2..7c3541e6 100644 --- a/src/ids.hpp +++ b/src/ids.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,9 +39,9 @@ enum ID_RefreshWithUpdate, ID_Filter_Min, ID_ShowUnversioned, - ID_ShowUnmodified, - ID_ShowModified, - ID_ShowConflicted, + ID_ShowUnmodified, + ID_ShowModified, + ID_ShowConflicted, ID_IgnoreExternals, ID_ShowIgnored, ID_Filter_Max, diff --git a/src/ignore_action.cpp b/src/ignore_action.cpp index 5f9465b5..2bdd9a48 100644 --- a/src/ignore_action.cpp +++ b/src/ignore_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,8 +36,8 @@ #include "ignore_action.hpp" #include "utils.hpp" -IgnoreAction::IgnoreAction (wxWindow * parent) - : Action (parent, _("Ignore"), UPDATE_TREE) +IgnoreAction::IgnoreAction(wxWindow * parent) + : Action(parent, _("Ignore"), UPDATE_TREE) { } @@ -46,18 +46,18 @@ IgnoreAction::~IgnoreAction() } bool -IgnoreAction::Perform () +IgnoreAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); - client.ignore (GetTargets ()); + client.ignore(GetTargets()); return true; } bool -IgnoreAction::CheckStatusSel (const svn::StatusSel & statusSel) +IgnoreAction::CheckStatusSel(const svn::StatusSel & statusSel) { - return !statusSel.hasVersioned (); + return !statusSel.hasVersioned(); } /* ----------------------------------------------------------------- diff --git a/src/ignore_action.hpp b/src/ignore_action.hpp index 63c43093..e51ccde0 100644 --- a/src/ignore_action.hpp +++ b/src/ignore_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -44,14 +44,14 @@ class IgnoreAction:public Action * * @param parent parent window */ - IgnoreAction (wxWindow * parent); - virtual ~IgnoreAction (); + IgnoreAction(wxWindow * parent); + virtual ~IgnoreAction(); - virtual bool - Perform (); + virtual bool + Perform(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: struct Data; diff --git a/src/import_action.cpp b/src/import_action.cpp index eadc3583..4aca226b 100644 --- a/src/import_action.cpp +++ b/src/import_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,56 +34,56 @@ #include "import_action.hpp" #include "utils.hpp" -ImportAction::ImportAction (wxWindow * parent) - :Action (parent, _("Import")) +ImportAction::ImportAction(wxWindow * parent) + :Action(parent, _("Import")) { } bool -ImportAction::Prepare () +ImportAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - const std::vector & v = GetTargets (); + const std::vector & v = GetTargets(); - svn::Path selectedPath (""); + svn::Path selectedPath(""); - if (v.size () == 1) + if (v.size() == 1) { selectedPath = v [0]; } - ImportDlg dlg (GetParent (), selectedPath); + ImportDlg dlg(GetParent(), selectedPath); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - m_data = dlg.GetData (); + m_data = dlg.GetData(); return true; } bool -ImportAction::Perform () +ImportAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); - svn::Path pathUtf8 (PathUtf8 (m_data.Path)); - svn::Path repositoryUtf8 (PathUtf8 (m_data.Repository)); - std::string LogMessageUtf8 (LocalToUtf8(m_data.LogMessage)); + svn::Path pathUtf8(PathUtf8(m_data.Path)); + svn::Path repositoryUtf8(PathUtf8(m_data.Repository)); + std::string LogMessageUtf8(LocalToUtf8(m_data.LogMessage)); - client.import (pathUtf8, repositoryUtf8.c_str (), - LogMessageUtf8.c_str (), m_data.Recursive); + client.import(pathUtf8, repositoryUtf8.c_str(), + LogMessageUtf8.c_str(), m_data.Recursive); return true; } bool -ImportAction::CheckStatusSel (const svn::StatusSel & statusSel) +ImportAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/import_action.hpp b/src/import_action.hpp index 520acd3a..82828fc9 100644 --- a/src/import_action.hpp +++ b/src/import_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,16 +37,16 @@ namespace svn class ImportAction:public Action { public: - ImportAction (wxWindow * parent); + ImportAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: ImportData m_data; diff --git a/src/import_data.hpp b/src/import_data.hpp index b146f7e3..da77fec6 100644 --- a/src/import_data.hpp +++ b/src/import_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/src/import_dlg.cpp b/src/import_dlg.cpp index a1a07943..dbed442a 100644 --- a/src/import_dlg.cpp +++ b/src/import_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -46,17 +46,17 @@ struct ImportDlg::Data public: ImportData data; - Data (wxWindow * window) + Data(wxWindow * window) { data.TreeType = true; data.FileType = !data.TreeType; data.Recursive = true; - InitControls (window); + InitControls(window); } void - InitControls (wxWindow * wnd) + InitControls(wxWindow * wnd) { wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); @@ -67,10 +67,10 @@ struct ImportDlg::Data Grid->Add(new wxStaticText(wnd, -1, _("Repository URL")), 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 5); - HistoryValidator val (HISTORY_REPOSITORY, &data.Repository); - wxComboBox *repository = - new wxComboBox (wnd, -1, wxEmptyString, wxDefaultPosition, - wxSize (235, -1), 0, 0, wxCB_DROPDOWN, val); + HistoryValidator val(HISTORY_REPOSITORY, &data.Repository); + wxComboBox *repository = + new wxComboBox(wnd, -1, wxEmptyString, wxDefaultPosition, + wxSize(235, -1), 0, 0, wxCB_DROPDOWN, val); Grid->Add(repository, 1, wxLEFT | wxEXPAND | wxALIGN_CENTER_VERTICAL, 5); Grid->Add(new wxStaticText(wnd, -1, wxEmptyString), 0, @@ -105,8 +105,8 @@ struct ImportDlg::Data // Sundry items row: wxBoxSizer *SundrySizer = new wxBoxSizer(wxHORIZONTAL); - wxCheckBox* Recursive = new wxCheckBox (wnd, -1, _("Recursive"), - wxDefaultPosition, wxDefaultSize, 0, wxGenericValidator(&data.Recursive)); + wxCheckBox* Recursive = new wxCheckBox(wnd, -1, _("Recursive"), + wxDefaultPosition, wxDefaultSize, 0, wxGenericValidator(&data.Recursive)); SundrySizer->Add(Recursive, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5); SundrySizer->Add(new wxStaticText(wnd, -1, _("Path type:")), 0, @@ -125,7 +125,7 @@ struct ImportDlg::Data // Button row wxBoxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL); - ButtonSizer->Add(new wxButton(wnd, wxID_OK, _("OK" )), 0, + ButtonSizer->Add(new wxButton(wnd, wxID_OK, _("OK")), 0, wxALL, 10); ButtonSizer->Add(new wxButton(wnd, wxID_CANCEL, _("Cancel")), 0, wxALL, 10); @@ -140,42 +140,42 @@ struct ImportDlg::Data } }; -BEGIN_EVENT_TABLE (ImportDlg, wxDialog) - EVT_BUTTON (wxID_OK, ImportDlg::OnOk) - EVT_BUTTON (ID_BUTTON_BROWSE, ImportDlg::OnBrowse) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(ImportDlg, wxDialog) + EVT_BUTTON(wxID_OK, ImportDlg::OnOk) + EVT_BUTTON(ID_BUTTON_BROWSE, ImportDlg::OnBrowse) +END_EVENT_TABLE() -ImportDlg::ImportDlg (wxWindow * parent, const svn::Path & selectedUrl) - : wxDialog (parent, -1, _("Import"), - wxDefaultPosition, - wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +ImportDlg::ImportDlg(wxWindow * parent, const svn::Path & selectedUrl) + : wxDialog(parent, -1, _("Import"), + wxDefaultPosition, + wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - m = new Data (this); + m = new Data(this); CentreOnParent(); - if (selectedUrl.isUrl ()) - m->data.Repository = Utf8ToLocal (selectedUrl.c_str ()); + if (selectedUrl.isUrl()) + m->data.Repository = Utf8ToLocal(selectedUrl.c_str()); } -ImportDlg::~ImportDlg () +ImportDlg::~ImportDlg() { delete m; } void -ImportDlg::OnOk (wxCommandEvent &event) +ImportDlg::OnOk(wxCommandEvent &event) { // Transfer data from controls into m_data: TransferDataFromWindow(); - TrimString (m->data.Repository); - TrimString (m->data.Path); - m->data.LogMessage.Trim (); + TrimString(m->data.Repository); + TrimString(m->data.Path); + m->data.LogMessage.Trim(); - if (m->data.Repository.IsEmpty ()) + if (m->data.Repository.IsEmpty()) { - wxMessageBox (_("Repository URL is required for import!"), - _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + wxMessageBox(_("Repository URL is required for import!"), + _("Error"), wxOK | wxCENTRE | wxICON_ERROR); // Do not allow the user to continue if the path is empty // and the import is addressing a file. @@ -185,49 +185,49 @@ ImportDlg::OnOk (wxCommandEvent &event) if (m->data.FileType) { - if (m->data.Path.IsEmpty ()) + if (m->data.Path.IsEmpty()) { - wxMessageBox (_("File path required when importing a file!"), - _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + wxMessageBox(_("File path required when importing a file!"), + _("Error"), wxOK | wxCENTRE | wxICON_ERROR); // Do not allow the user to continue if the reposURL is empty. return; } } - wxDialog::EndModal (wxID_OK); + wxDialog::EndModal(wxID_OK); } void -ImportDlg::OnBrowse (wxCommandEvent & WXUNUSED (event)) +ImportDlg::OnBrowse(wxCommandEvent & WXUNUSED(event)) { // Transfer data from controls into m->data: TransferDataFromWindow(); if (m->data.TreeType) { - wxDirDialog dialog (this, - _("Select a directory to import"), - m->data.Path); + wxDirDialog dialog(this, + _("Select a directory to import"), + m->data.Path); - if (dialog.ShowModal () == wxID_OK) - m->data.Path = dialog.GetPath (); + if (dialog.ShowModal() == wxID_OK) + m->data.Path = dialog.GetPath(); } else // it's a file { - wxFileDialog dialog (this, - _("Select a file to import"), - m->data.Path); + wxFileDialog dialog(this, + _("Select a file to import"), + m->data.Path); - if (dialog.ShowModal () == wxID_OK) - m->data.Path = dialog.GetPath (); + if (dialog.ShowModal() == wxID_OK) + m->data.Path = dialog.GetPath(); } // Transfer data from m->data back into controls: TransferDataToWindow(); } ImportData & -ImportDlg::GetData () +ImportDlg::GetData() { return m->data; } diff --git a/src/import_dlg.hpp b/src/import_dlg.hpp index 535ec980..9e356c7d 100644 --- a/src/import_dlg.hpp +++ b/src/import_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -45,18 +45,18 @@ class ImportDlg:public wxDialog * @param parent window * @param selectedUrl Use this value to pre-fill the URL */ - ImportDlg (wxWindow *parent, const svn::Path & selectedUrl); + ImportDlg(wxWindow *parent, const svn::Path & selectedUrl); /** * Destructor */ - virtual ~ImportDlg (); + virtual ~ImportDlg(); /** * return the reference to @a ImportData */ ImportData & - GetData (); + GetData(); private: /** hide implementation details */ @@ -66,19 +66,19 @@ class ImportDlg:public wxDialog /** * Event handler for OK button */ - void OnOk (wxCommandEvent & event); + void OnOk(wxCommandEvent & event); /** * Event handler for Browser button */ - void OnBrowse (wxCommandEvent & event); + void OnBrowse(wxCommandEvent & event); /** * Event handler for changes in text fields */ - void OnText (wxCommandEvent & event); + void OnText(wxCommandEvent & event); - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/listed_dlg.cpp b/src/listed_dlg.cpp index 73901c13..ad9fc20b 100644 --- a/src/listed_dlg.cpp +++ b/src/listed_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -62,10 +62,10 @@ static const wxChar * LABEL_DELETE=_("&Delete..."); class ListCtrl : public wxListView { public: - ListCtrl (wxWindow * parent) - : wxListView (parent, ID_List, wxDefaultPosition, - wxSize (350, 150), wxLC_REPORT | - wxLC_SINGLE_SEL) + ListCtrl(wxWindow * parent) + : wxListView(parent, ID_List, wxDefaultPosition, + wxSize(350, 150), wxLC_REPORT | + wxLC_SINGLE_SEL) { wxListItem info; @@ -73,12 +73,12 @@ class ListCtrl : public wxListView info.m_col = 0; info.m_width = 120; info.m_text = _("Name"); - InsertColumn (0, info); + InsertColumn(0, info); info.m_col = 1; info.m_width = 240; info.m_text = _("Value"); - InsertColumn (1, info); + InsertColumn(1, info); } /** @@ -91,17 +91,17 @@ class ListCtrl : public wxListView * @return id of new item if inserted or old item if updated */ long - SetEntry (const wxString & name, const wxString & value) + SetEntry(const wxString & name, const wxString & value) { - long id = FindItem (-1, name, false); + long id = FindItem(-1, name, false); if (-1 != id) m_values [id] = value; else { - id = GetItemCount (); - InsertItem (id, name); - m_values.push_back (value); + id = GetItemCount(); + InsertItem(id, name); + m_values.push_back(value); } wxListItem item; @@ -109,7 +109,7 @@ class ListCtrl : public wxListView item.m_text = value; item.m_col = 1; item.m_mask = wxLIST_MASK_TEXT; - SetItem (item); + SetItem(item); return id; } @@ -123,13 +123,13 @@ class ListCtrl : public wxListView * @retval false nothing selected */ bool - GetSelectedEntry (wxString & name, wxString & value) + GetSelectedEntry(wxString & name, wxString & value) { - long id = GetFirstSelected (); + long id = GetFirstSelected(); if (id == -1) return false; - GetEntryAtIndex (id, name, value); + GetEntryAtIndex(id, name, value); return true; } @@ -141,10 +141,10 @@ class ListCtrl : public wxListView * @param value property value */ void - GetEntryAtIndex (long id, wxString & name, wxString & value) + GetEntryAtIndex(long id, wxString & name, wxString & value) { // get name - name = GetItemText (id); + name = GetItemText(id); // get value value = m_values[id]; @@ -164,42 +164,42 @@ class EntryDlg : public wxDialog /** * Constructor */ - EntryDlg (wxWindow * parent, const wxString & title) - : wxDialog (parent, -1, title, wxDefaultPosition), - m_readOnly (false) + EntryDlg(wxWindow * parent, const wxString & title) + : wxDialog(parent, -1, title, wxDefaultPosition), + m_readOnly(false) { - wxStaticText * labelName = new wxStaticText (this, -1, _("Name")); - wxStaticText * labelValue = new wxStaticText (this, -1, _("Value")); - wxTextCtrl * textName = new wxTextCtrl (this, ID_Name); + wxStaticText * labelName = new wxStaticText(this, -1, _("Name")); + wxStaticText * labelValue = new wxStaticText(this, -1, _("Value")); + wxTextCtrl * textName = new wxTextCtrl(this, ID_Name); wxTextCtrl * textValue = - new wxTextCtrl (this, ID_Value, wxEmptyString, wxDefaultPosition, - wxSize (300, 100), wxTE_MULTILINE); + new wxTextCtrl(this, ID_Value, wxEmptyString, wxDefaultPosition, + wxSize(300, 100), wxTE_MULTILINE); - wxFlexGridSizer * textSizer = new wxFlexGridSizer (2, 5, 5); - textSizer->Add (labelName); - textSizer->Add (textName, 1, wxEXPAND); - textSizer->Add (labelValue); - textSizer->Add (textValue, 1, wxEXPAND); + wxFlexGridSizer * textSizer = new wxFlexGridSizer(2, 5, 5); + textSizer->Add(labelName); + textSizer->Add(textName, 1, wxEXPAND); + textSizer->Add(labelValue); + textSizer->Add(textValue, 1, wxEXPAND); - wxButton * okButton = new wxButton (this, wxID_OK, _("OK")); - wxButton * cancelButton = new wxButton (this, wxID_CANCEL, _("Cancel")); - wxBoxSizer * buttonSizer = new wxBoxSizer (wxHORIZONTAL); - buttonSizer->Add (okButton, 0, wxALL, 5); - buttonSizer->Add (cancelButton, 0, wxALL, 5); + wxButton * okButton = new wxButton(this, wxID_OK, _("OK")); + wxButton * cancelButton = new wxButton(this, wxID_CANCEL, _("Cancel")); + wxBoxSizer * buttonSizer = new wxBoxSizer(wxHORIZONTAL); + buttonSizer->Add(okButton, 0, wxALL, 5); + buttonSizer->Add(cancelButton, 0, wxALL, 5); - wxBoxSizer * mainSizer = new wxBoxSizer (wxVERTICAL); + wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); - mainSizer->Add (textSizer, 1, wxALL | wxEXPAND, 5); - mainSizer->Add (buttonSizer, 0, wxALL | wxALIGN_RIGHT , 5); + mainSizer->Add(textSizer, 1, wxALL | wxEXPAND, 5); + mainSizer->Add(buttonSizer, 0, wxALL | wxALIGN_RIGHT , 5); - okButton->SetDefault (); + okButton->SetDefault(); - SetAutoLayout (true); - SetSizer (mainSizer); + SetAutoLayout(true); + SetSizer(mainSizer); - mainSizer->SetSizeHints (this); - mainSizer->Fit (this); + mainSizer->SetSizeHints(this); + mainSizer->Fit(this); m_buttonOk = okButton; m_textName = textName; @@ -218,9 +218,9 @@ class EntryDlg : public wxDialog * @retval true if OK button was clicked */ bool - Execute (const int mode, - wxString & name, - wxString & value) + Execute(const int mode, + wxString & name, + wxString & value) { switch (mode) { @@ -233,44 +233,44 @@ class EntryDlg : public wxDialog } m_mode = mode; - SetReturnCode (wxID_CANCEL); - m_textName->Enable (mode == EDIT_NEW); - TrimString (name); - TrimString (value); - m_textName->SetValue (name); - m_textValue->SetValue (value); + SetReturnCode(wxID_CANCEL); + m_textName->Enable(mode == EDIT_NEW); + TrimString(name); + TrimString(value); + m_textName->SetValue(name); + m_textValue->SetValue(value); - CheckButtons (); + CheckButtons(); - bool ok = ShowModal () == wxID_OK; + bool ok = ShowModal() == wxID_OK; if (ok) { - name = m_textName->GetValue (); - value = m_textValue->GetValue (); - TrimString (name); - TrimString (value); + name = m_textName->GetValue(); + value = m_textValue->GetValue(); + TrimString(name); + TrimString(value); } return ok; } - void SetNameCaption (const wxString & caption) + void SetNameCaption(const wxString & caption) { - m_labelName->SetLabel (caption); + m_labelName->SetLabel(caption); } - void SetValueCaption (const wxString & caption) + void SetValueCaption(const wxString & caption) { - m_labelValue->SetLabel (caption); + m_labelValue->SetLabel(caption); } - void SetReadOnly (bool value) + void SetReadOnly(bool value) { m_readOnly = value; - m_textName->Enable ((m_mode == EDIT_NEW) && !value); - m_textValue->Enable (!value); - CheckButtons (); + m_textName->Enable((m_mode == EDIT_NEW) && !value); + m_textValue->Enable(!value); + CheckButtons(); } private: @@ -283,26 +283,26 @@ class EntryDlg : public wxDialog int m_mode; void - OnName (wxCommandEvent &) + OnName(wxCommandEvent &) { - CheckButtons (); + CheckButtons(); } void - CheckButtons () + CheckButtons() { - wxString name = m_textName->GetValue (); - TrimString (name); - m_buttonOk->Enable ((name.Length () > 0) && !m_readOnly); + wxString name = m_textName->GetValue(); + TrimString(name); + m_buttonOk->Enable((name.Length() > 0) && !m_readOnly); } private: - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE (EntryDlg, wxDialog) - EVT_TEXT (ID_Name, EntryDlg::OnName) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(EntryDlg, wxDialog) + EVT_TEXT(ID_Name, EntryDlg::OnName) +END_EVENT_TABLE() struct ListEditorDlg::Data { @@ -320,46 +320,46 @@ struct ListEditorDlg::Data wxString editTitle; public: - Data (wxWindow * wnd) - : window (wnd), nameCaption (_("Name")), valueCaption (_("Value")), - readOnly (false) + Data(wxWindow * wnd) + : window(wnd), nameCaption(_("Name")), valueCaption(_("Value")), + readOnly(false) { // create controls - wxStaticBoxSizer *boxSizer = new wxStaticBoxSizer ( - box = new wxStaticBox (wnd, -1, wxEmptyString), + wxStaticBoxSizer *boxSizer = new wxStaticBoxSizer( + box = new wxStaticBox(wnd, -1, wxEmptyString), wxHORIZONTAL); - listCtrl = new ListCtrl (wnd); - boxSizer->Add (listCtrl, 1, wxALL | wxEXPAND, 2); + listCtrl = new ListCtrl(wnd); + boxSizer->Add(listCtrl, 1, wxALL | wxEXPAND, 2); // buttons - newButton = new wxButton (wnd, ID_New, LABEL_NEW); - editButton = new wxButton (wnd, ID_Edit, LABEL_EDIT); - editButton->Enable (false); - delButton = new wxButton (wnd, ID_Delete, LABEL_DELETE); - delButton->Enable (false); - okButton = new wxButton (wnd, wxID_OK, _("OK")); - wxButton * cancelButton = new wxButton (wnd, wxID_CANCEL, _("Cancel")); - - wxBoxSizer * buttonSizer = new wxBoxSizer (wxHORIZONTAL); - buttonSizer->Add (newButton, 0, wxALL, 5); - buttonSizer->Add (editButton, 0, wxALL, 5); - buttonSizer->Add (delButton, 0, wxALL, 5); - buttonSizer->Add (20, 20); - buttonSizer->Add (okButton, 0, wxALL, 5); - buttonSizer->Add (cancelButton, 0, wxALL, 5); - - cancelButton->SetDefault (); - wxBoxSizer * mainSizer = new wxBoxSizer (wxVERTICAL); - - mainSizer->Add (boxSizer, 1, wxALL | wxCENTER | wxEXPAND , 5); - mainSizer->Add (buttonSizer, 0, wxALL | wxALIGN_RIGHT , 5); - - wnd->SetAutoLayout (true); - wnd->SetSizer (mainSizer); - - mainSizer->SetSizeHints (wnd); - mainSizer->Fit (wnd); + newButton = new wxButton(wnd, ID_New, LABEL_NEW); + editButton = new wxButton(wnd, ID_Edit, LABEL_EDIT); + editButton->Enable(false); + delButton = new wxButton(wnd, ID_Delete, LABEL_DELETE); + delButton->Enable(false); + okButton = new wxButton(wnd, wxID_OK, _("OK")); + wxButton * cancelButton = new wxButton(wnd, wxID_CANCEL, _("Cancel")); + + wxBoxSizer * buttonSizer = new wxBoxSizer(wxHORIZONTAL); + buttonSizer->Add(newButton, 0, wxALL, 5); + buttonSizer->Add(editButton, 0, wxALL, 5); + buttonSizer->Add(delButton, 0, wxALL, 5); + buttonSizer->Add(20, 20); + buttonSizer->Add(okButton, 0, wxALL, 5); + buttonSizer->Add(cancelButton, 0, wxALL, 5); + + cancelButton->SetDefault(); + wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); + + mainSizer->Add(boxSizer, 1, wxALL | wxCENTER | wxEXPAND , 5); + mainSizer->Add(buttonSizer, 0, wxALL | wxALIGN_RIGHT , 5); + + wnd->SetAutoLayout(true); + wnd->SetSizer(mainSizer); + + mainSizer->SetSizeHints(wnd); + mainSizer->Fit(wnd); } @@ -369,12 +369,12 @@ struct ListEditorDlg::Data * @retval true item is selected */ bool - IsSelected () + IsSelected() { if (!listCtrl) return false; - return listCtrl->GetFirstSelected () != -1; + return listCtrl->GetFirstSelected() != -1; } /** @@ -382,28 +382,28 @@ struct ListEditorDlg::Data * the grid */ void - OnSelected () + OnSelected() { // the edit and delete buttons will only be // enabled if there is a selected item - bool selected = IsSelected (); - editButton->Enable (selected); - delButton->Enable (selected && !readOnly); + bool selected = IsSelected(); + editButton->Enable(selected); + delButton->Enable(selected && !readOnly); } /** * deletes the selected item in the list */ void - DeleteSelected () + DeleteSelected() { - long id = listCtrl->GetFirstSelected (); + long id = listCtrl->GetFirstSelected(); if (id == -1) return; - listCtrl->DeleteItem (id); - OnSelected (); + listCtrl->DeleteItem(id); + OnSelected(); } /** @@ -412,7 +412,7 @@ struct ListEditorDlg::Data * @param edit EDIT_NEW or EDIT_EDIT */ void - Edit (int mode) + Edit(int mode) { wxString name, value, title; @@ -421,146 +421,146 @@ struct ListEditorDlg::Data else { title = editTitle; - listCtrl->GetSelectedEntry (name, value); + listCtrl->GetSelectedEntry(name, value); } - EntryDlg dlg (window, title); - dlg.SetReadOnly (readOnly); - if (!dlg.Execute (mode, name, value)) + EntryDlg dlg(window, title); + dlg.SetReadOnly(readOnly); + if (!dlg.Execute(mode, name, value)) return; - listCtrl->SetEntry (name, value); + listCtrl->SetEntry(name, value); } }; -BEGIN_EVENT_TABLE (ListEditorDlg, wxDialog) - EVT_BUTTON (ID_New, ListEditorDlg::OnNew) - EVT_BUTTON (ID_Edit, ListEditorDlg::OnEdit) - EVT_BUTTON (ID_Delete, ListEditorDlg::OnDelete) - EVT_LIST_ITEM_SELECTED (ID_List, ListEditorDlg::OnSelected) -END_EVENT_TABLE () - -ListEditorDlg::ListEditorDlg (wxWindow * parent, - const wxString & title) - : wxDialog (parent, -1, title, wxDefaultPosition, - wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +BEGIN_EVENT_TABLE(ListEditorDlg, wxDialog) + EVT_BUTTON(ID_New, ListEditorDlg::OnNew) + EVT_BUTTON(ID_Edit, ListEditorDlg::OnEdit) + EVT_BUTTON(ID_Delete, ListEditorDlg::OnDelete) + EVT_LIST_ITEM_SELECTED(ID_List, ListEditorDlg::OnSelected) +END_EVENT_TABLE() + +ListEditorDlg::ListEditorDlg(wxWindow * parent, + const wxString & title) + : wxDialog(parent, -1, title, wxDefaultPosition, + wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - m = new Data (this); - CentreOnParent (); + m = new Data(this); + CentreOnParent(); } -ListEditorDlg::~ListEditorDlg () +ListEditorDlg::~ListEditorDlg() { delete m; } void -ListEditorDlg::OnNew (wxCommandEvent & event) +ListEditorDlg::OnNew(wxCommandEvent & event) { - m->Edit (EDIT_NEW); + m->Edit(EDIT_NEW); } void -ListEditorDlg::OnEdit (wxCommandEvent & event) +ListEditorDlg::OnEdit(wxCommandEvent & event) { - m->Edit (EDIT_EDIT); + m->Edit(EDIT_EDIT); } void -ListEditorDlg::OnDelete (wxCommandEvent & event) +ListEditorDlg::OnDelete(wxCommandEvent & event) { - m->DeleteSelected (); + m->DeleteSelected(); } void -ListEditorDlg::OnSelected (wxListEvent &) +ListEditorDlg::OnSelected(wxListEvent &) { - m->OnSelected (); + m->OnSelected(); } void -ListEditorDlg::SetCaption (const wxString & caption) +ListEditorDlg::SetCaption(const wxString & caption) { - m->box->SetLabel (caption); + m->box->SetLabel(caption); } void -ListEditorDlg::SetNameCaption (const wxString & caption) +ListEditorDlg::SetNameCaption(const wxString & caption) { m->nameCaption = caption; } void -ListEditorDlg::SetValueCaption (const wxString & caption) +ListEditorDlg::SetValueCaption(const wxString & caption) { m->valueCaption = caption; } void -ListEditorDlg::SetAddTitle (const wxString & title) +ListEditorDlg::SetAddTitle(const wxString & title) { m->addTitle = title; } void -ListEditorDlg::SetEditTitle (const wxString & title) +ListEditorDlg::SetEditTitle(const wxString & title) { m->editTitle = title; } void -ListEditorDlg::DeleteAllEntries () +ListEditorDlg::DeleteAllEntries() { - m->listCtrl->DeleteAllItems (); + m->listCtrl->DeleteAllItems(); } long -ListEditorDlg::SetEntry (const wxString & name, const wxString & value) +ListEditorDlg::SetEntry(const wxString & name, const wxString & value) { - return m->listCtrl->SetEntry (name, value); + return m->listCtrl->SetEntry(name, value); } void -ListEditorDlg::GetEntryAtIndex (long id, wxString & name, wxString & value) const +ListEditorDlg::GetEntryAtIndex(long id, wxString & name, wxString & value) const { - m->listCtrl->GetEntryAtIndex (id, name, value); + m->listCtrl->GetEntryAtIndex(id, name, value); } long -ListEditorDlg::GetEntryCount () const +ListEditorDlg::GetEntryCount() const { - return m->listCtrl->GetItemCount (); + return m->listCtrl->GetItemCount(); } int -ListEditorDlg::ShowModal () +ListEditorDlg::ShowModal() { int result; - WriteToGrid (); + WriteToGrid(); - result = wxDialog::ShowModal (); + result = wxDialog::ShowModal(); if (result == wxID_OK) - ReadFromGrid (); + ReadFromGrid(); return result; } long -ListEditorDlg::FindEntry (const wxString & name) const +ListEditorDlg::FindEntry(const wxString & name) const { - return m->listCtrl->FindItem (-1, name, false); + return m->listCtrl->FindItem(-1, name, false); } void -ListEditorDlg::SetReadOnly (bool value) +ListEditorDlg::SetReadOnly(bool value) { m->readOnly = value; - m->newButton->Enable (!value); - m->okButton->Enable (!value); - m->OnSelected (); - m->editButton->SetLabel (value ? LABEL_VIEW : LABEL_EDIT); + m->newButton->Enable(!value); + m->okButton->Enable(!value); + m->OnSelected(); + m->editButton->SetLabel(value ? LABEL_VIEW : LABEL_EDIT); } /* ----------------------------------------------------------------- diff --git a/src/listed_dlg.hpp b/src/listed_dlg.hpp index 48a9ba3a..61312f46 100644 --- a/src/listed_dlg.hpp +++ b/src/listed_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,45 +35,45 @@ class wxListEvent; class ListEditorDlg : public wxDialog { public: - ListEditorDlg (wxWindow * parent, const wxString & title); + ListEditorDlg(wxWindow * parent, const wxString & title); /** * destructor */ - virtual ~ListEditorDlg (); + virtual ~ListEditorDlg(); void - SetAddTitle (const wxString & title); + SetAddTitle(const wxString & title); void - SetEditTitle (const wxString & title); + SetEditTitle(const wxString & title); void - SetValueCaption (const wxString & caption); + SetValueCaption(const wxString & caption); void - SetNameCaption (const wxString & caption); + SetNameCaption(const wxString & caption); void - SetCaption (const wxString & caption); + SetCaption(const wxString & caption); void - DeleteAllEntries (); + DeleteAllEntries(); long - SetEntry (const wxString & name, const wxString & value); + SetEntry(const wxString & name, const wxString & value); void - GetEntryAtIndex (long id, wxString & name, wxString & value) const; + GetEntryAtIndex(long id, wxString & name, wxString & value) const; long - GetEntryCount () const; + GetEntryCount() const; long - FindEntry (const wxString & name) const; + FindEntry(const wxString & name) const; virtual int - ShowModal (); + ShowModal(); /** * enables or disables the saving/modification @@ -84,10 +84,10 @@ class ListEditorDlg : public wxDialog protected: virtual void - ReadFromGrid () = 0; + ReadFromGrid() = 0; virtual void - WriteToGrid () = 0; + WriteToGrid() = 0; private: struct Data; @@ -96,12 +96,12 @@ class ListEditorDlg : public wxDialog /** * disallow default constructor */ - ListEditorDlg (); + ListEditorDlg(); /** * disallow copy constructor */ - ListEditorDlg (const ListEditorDlg &); + ListEditorDlg(const ListEditorDlg &); /** * disallow assignment operator @@ -110,28 +110,28 @@ class ListEditorDlg : public wxDialog operator = (const ListEditorDlg &); void - CheckButtons (); + CheckButtons(); void - OnClose (wxCommandEvent & event); + OnClose(wxCommandEvent & event); void - OnOK (wxCommandEvent & event); + OnOK(wxCommandEvent & event); void - OnNew (wxCommandEvent & event); + OnNew(wxCommandEvent & event); void - OnEdit (wxCommandEvent & event); + OnEdit(wxCommandEvent & event); void - OnDelete (wxCommandEvent & event); + OnDelete(wxCommandEvent & event); void - OnSelected (wxListEvent & event); + OnSelected(wxListEvent & event); private: - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/listener.cpp b/src/listener.cpp index 169f2b7d..8b57e861 100644 --- a/src/listener.cpp +++ b/src/listener.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -98,14 +98,14 @@ struct Listener::Data apr_uint32_t acceptedFailures; - Data (wxWindow * parent_) - : parent (parent_), tracer (NULL), ownTracer (false), - isCancelled (false), context (NULL), dataReceived (false) + Data(wxWindow * parent_) + : parent(parent_), tracer(NULL), ownTracer(false), + isCancelled(false), context(NULL), dataReceived(false) { - parentDoneSignal = new wxCondition (mutex); + parentDoneSignal = new wxCondition(mutex); } - virtual ~Data () + virtual ~Data() { delete parentDoneSignal; @@ -125,227 +125,227 @@ struct Listener::Data * can skip the shit and wait here */ void - sendSignalAndWait (int id) + sendSignalAndWait(int id) { - wxCommandEvent event (wxEVT_COMMAND_MENU_SELECTED, id); + wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, id); - if (::wxIsMainThread ()) + if (::wxIsMainThread()) { // single threaded environment or // already in the main thread - handleEvent (event); + handleEvent(event); } else { - wxPostEvent (parent, event); - parentDoneSignal->Wait (); + wxPostEvent(parent, event); + parentDoneSignal->Wait(); } } - + /** * The callback functions will call this * function to signal they are done; * if we are already in the main thread * we do nothing. */ - void signalDone () + void signalDone() { - /** + /** * @todo we have to see whether this works in Linux - * as well. Maybe we may call this only if + * as well. Maybe we may call this only if * @ref sendSignalAndWait was called from a different * thread. */ - parentDoneSignal->Broadcast (); + parentDoneSignal->Broadcast(); } void - callbackSslClientCertPrompt () + callbackSslClientCertPrompt() { - wxMutexLocker lock (mutex); - wxString localCertFile = wxFileSelector ( - _("Select Certificate File"), wxT(""), wxT(""), wxT(""), - wxT("*.*"), wxOPEN | wxFILE_MUST_EXIST, parent); - LocalToUtf8 (localCertFile, certFile); + wxMutexLocker lock(mutex); + wxString localCertFile = wxFileSelector( + _("Select Certificate File"), wxT(""), wxT(""), wxT(""), + wxT("*.*"), wxOPEN | wxFILE_MUST_EXIST, parent); + LocalToUtf8(localCertFile, certFile); - dataReceived = !localCertFile.empty (); + dataReceived = !localCertFile.empty(); - signalDone (); + signalDone(); } void - callbackGetLogin () + callbackGetLogin() { - wxMutexLocker lock (mutex); + wxMutexLocker lock(mutex); // TODO: show realm - wxString LocalUsername (Utf8ToLocal (username)); - wxString LocalPassword (Utf8ToLocal (password)); - AuthDlg dlg (parent, LocalUsername, LocalPassword); + wxString LocalUsername(Utf8ToLocal(username)); + wxString LocalPassword(Utf8ToLocal(password)); + AuthDlg dlg(parent, LocalUsername, LocalPassword); - bool ok = dlg.ShowModal () == wxID_OK; + bool ok = dlg.ShowModal() == wxID_OK; if (ok) { - LocalToUtf8 (dlg.GetUsername (), username); - LocalToUtf8 (dlg.GetPassword (), password); + LocalToUtf8(dlg.GetUsername(), username); + LocalToUtf8(dlg.GetPassword(), password); dataReceived = true; } - signalDone (); + signalDone(); } void - callbackGetLogMessage () + callbackGetLogMessage() { - wxMutexLocker lock (mutex); - CommitDlg dlg (parent, true); + wxMutexLocker lock(mutex); + CommitDlg dlg(parent, true); - bool ok = dlg.ShowModal () == wxID_OK; + bool ok = dlg.ShowModal() == wxID_OK; if (ok) { - LocalToUtf8 (dlg.GetMessage (), message); + LocalToUtf8(dlg.GetMessage(), message); dataReceived = true; } - signalDone (); + signalDone(); } void - callbackSslServerTrustPrompt () + callbackSslServerTrustPrompt() { - wxMutexLocker lock (mutex); - CertDlg dlg (parent, sslServerTrustData); + wxMutexLocker lock(mutex); + CertDlg dlg(parent, sslServerTrustData); - dlg.ShowModal (); - acceptedFailures = dlg.AcceptedFailures (); + dlg.ShowModal(); + acceptedFailures = dlg.AcceptedFailures(); - sslServerTrustAnswer = dlg.Answer (); + sslServerTrustAnswer = dlg.Answer(); dataReceived = true; - signalDone (); + signalDone(); } void - callbackSslClientCertPwPrompt () + callbackSslClientCertPwPrompt() { - wxMutexLocker lock (mutex); - wxString LocalPassword(Utf8ToLocal (password)); - AuthDlg dlg (parent, wxEmptyString, LocalPassword, - AuthDlg::HIDE_USERNAME); + wxMutexLocker lock(mutex); + wxString LocalPassword(Utf8ToLocal(password)); + AuthDlg dlg(parent, wxEmptyString, LocalPassword, + AuthDlg::HIDE_USERNAME); - dataReceived = dlg.ShowModal () == wxID_OK; + dataReceived = dlg.ShowModal() == wxID_OK; if (dataReceived) - LocalToUtf8 (dlg.GetPassword (), password); + LocalToUtf8(dlg.GetPassword(), password); - signalDone (); + signalDone(); } - void - handleEvent (wxCommandEvent & event) + void + handleEvent(wxCommandEvent & event) { - switch (event.GetId ()) + switch (event.GetId()) { case SIG_GET_LOG_MSG: - callbackGetLogMessage (); + callbackGetLogMessage(); break; case SIG_GET_LOGIN: - callbackGetLogin (); + callbackGetLogin(); break; case SIG_SSL_SERVER_TRUST_PROMPT: - callbackSslServerTrustPrompt (); + callbackSslServerTrustPrompt(); break; case SIG_SSL_CLIENT_CERT_PROMPT: - callbackSslClientCertPrompt (); + callbackSslClientCertPrompt(); break; case SIG_SSL_CLIENT_CERT_PW_PROMPT: - callbackSslClientCertPwPrompt (); + callbackSslClientCertPwPrompt(); break; default: - // Oh well, no default reaction *sigh* + // Oh well, no default reaction *sigh* ; } } }; -Listener::Listener (wxWindow * parent) +Listener::Listener(wxWindow * parent) { - m = new Data (parent); + m = new Data(parent); } -Listener::~Listener () +Listener::~Listener() { delete m; } void -Listener::SetTracer (Tracer * t, bool own) +Listener::SetTracer(Tracer * t, bool own) { m->tracer = t; m->ownTracer = own; } Tracer * -Listener::GetTracer () +Listener::GetTracer() { return m->tracer; } wxWindow * -Listener::GetParent () +Listener::GetParent() { return m->parent; } void -Listener::Trace (const wxString & msg) +Listener::Trace(const wxString & msg) { if (m->tracer) { - m->tracer->Trace (msg); + m->tracer->Trace(msg); } } void -Listener::SetParent (wxWindow * parent) +Listener::SetParent(wxWindow * parent) { m->parent = parent; } void -Listener::SetContext (svn::Context * context) +Listener::SetContext(svn::Context * context) { m->context = context; } svn::Context * -Listener::GetContext () +Listener::GetContext() { return m->context; } void -Listener::contextNotify (const char *path, - svn_wc_notify_action_t action, - svn_node_kind_t kind, - const char *mime_type, - svn_wc_notify_state_t content_state, - svn_wc_notify_state_t prop_state, - svn_revnum_t revision) +Listener::contextNotify(const char *path, + svn_wc_notify_action_t action, + svn_node_kind_t kind, + const char *mime_type, + svn_wc_notify_state_t content_state, + svn_wc_notify_state_t prop_state, + svn_revnum_t revision) { static const wxChar * ACTION_NAMES [] = @@ -382,31 +382,31 @@ Listener::contextNotify (const char *path, if (ACTION_NAMES[action] != NULL && action >= 0 && action <= MAX_ACTION) { static wxString msg; - msg.Printf (wxT("%s: %s"), ACTION_NAMES[action], Utf8ToLocal (path).c_str ()); + msg.Printf(wxT("%s: %s"), ACTION_NAMES[action], Utf8ToLocal(path).c_str()); - Trace (msg); + Trace(msg); } #ifdef USE_SIMPLE_WORKER - static apr_time_t last_access = apr_time_now (); - if (apr_time_now () - last_access > 2000000) + static apr_time_t last_access = apr_time_now(); + if (apr_time_now() - last_access > 2000000) { - last_access = apr_time_now (); - wxSafeYield (); + last_access = apr_time_now(); + wxSafeYield(); } #endif } bool -Listener::contextGetLogin (const std::string & realm, - std::string & username, - std::string & password, - bool & maySave) +Listener::contextGetLogin(const std::string & realm, + std::string & username, + std::string & password, + bool & maySave) { m->username = username; m->password = password; - m->sendSignalAndWait (SIG_GET_LOGIN); + m->sendSignalAndWait(SIG_GET_LOGIN); // Parent has done its job and signalled. Performing main condition check. bool success = m->dataReceived; @@ -422,11 +422,11 @@ Listener::contextGetLogin (const std::string & realm, } bool -Listener::contextGetLogMessage (std::string & msg) +Listener::contextGetLogMessage(std::string & msg) { m->message = msg; - m->sendSignalAndWait (SIG_GET_LOG_MSG); + m->sendSignalAndWait(SIG_GET_LOG_MSG); bool success = m->dataReceived; m->dataReceived = false; @@ -440,12 +440,12 @@ Listener::contextGetLogMessage (std::string & msg) svn::ContextListener::SslServerTrustAnswer -Listener::contextSslServerTrustPrompt ( +Listener::contextSslServerTrustPrompt( const svn::ContextListener::SslServerTrustData & data, apr_uint32_t & acceptedFailures) { m->sslServerTrustData = data; - m->sendSignalAndWait (SIG_SSL_SERVER_TRUST_PROMPT); + m->sendSignalAndWait(SIG_SSL_SERVER_TRUST_PROMPT); m->dataReceived = false; return m->sslServerTrustAnswer; @@ -453,9 +453,9 @@ Listener::contextSslServerTrustPrompt ( bool -Listener::contextSslClientCertPrompt (std::string & certFile) +Listener::contextSslClientCertPrompt(std::string & certFile) { - m->sendSignalAndWait (SIG_SSL_CLIENT_CERT_PROMPT); + m->sendSignalAndWait(SIG_SSL_CLIENT_CERT_PROMPT); bool success = m->dataReceived; m->dataReceived = false; @@ -470,20 +470,20 @@ Listener::contextSslClientCertPrompt (std::string & certFile) bool -Listener::contextSslClientCertPwPrompt (std::string & password, - const std::string & realm, - bool & maySave) +Listener::contextSslClientCertPwPrompt(std::string & password, + const std::string & realm, + bool & maySave) { /// @todo @ref realm isnt used yet /// @todo @ref maySave isnt used yet m->password = password; - - m->sendSignalAndWait (SIG_SSL_CLIENT_CERT_PW_PROMPT); + + m->sendSignalAndWait(SIG_SSL_CLIENT_CERT_PW_PROMPT); bool success = m->dataReceived; m->dataReceived = false; - if(!success) + if (!success) return false; password = m->password; @@ -491,27 +491,27 @@ Listener::contextSslClientCertPwPrompt (std::string & password, } bool -Listener::contextCancel () +Listener::contextCancel() { return m->isCancelled; } bool -Listener::isCancelled () const +Listener::isCancelled() const { return m->isCancelled; } void -Listener::cancel (bool value) +Listener::cancel(bool value) { m->isCancelled = value; } void -Listener::handleEvent (wxCommandEvent & event) +Listener::handleEvent(wxCommandEvent & event) { - m->handleEvent (event); + m->handleEvent(event); } /* ----------------------------------------------------------------- diff --git a/src/listener.hpp b/src/listener.hpp index b34564d8..c276c0f3 100644 --- a/src/listener.hpp +++ b/src/listener.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -55,82 +55,82 @@ class Listener : public svn::ContextListener * * @param parent parent window */ - Listener (wxWindow * parent); + Listener(wxWindow * parent); /** * destructor */ - virtual ~Listener (); + virtual ~Listener(); /** * @return Tracer instance */ - Tracer * GetTracer (); + Tracer * GetTracer(); /** * Sets the tracer passed as an argument. * If own is TRUE, then the @a Listener class * is responsible for deleting the tracer. */ - void SetTracer (Tracer * t, bool own); + void SetTracer(Tracer * t, bool own); /** * set actions parent window * * @param parent the parent that will receive events */ - void SetParent (wxWindow * parent); + void SetParent(wxWindow * parent); /** * @return parent */ - wxWindow * GetParent (); + wxWindow * GetParent(); /** * sets the context * * @param context */ - void SetContext (svn::Context * context); + void SetContext(svn::Context * context); /** * @return the context of the action */ svn::Context * - GetContext (); + GetContext(); /** * @see svn::ContextListener */ virtual bool - contextGetLogin (const std::string & realm, - std::string & username, - std::string & password, - bool & maySave); + contextGetLogin(const std::string & realm, + std::string & username, + std::string & password, + bool & maySave); /** * @see svn::ContextListener */ virtual void - contextNotify (const char *path, - svn_wc_notify_action_t action, - svn_node_kind_t kind, - const char *mime_type, - svn_wc_notify_state_t content_state, - svn_wc_notify_state_t prop_state, - svn_revnum_t revision); + contextNotify(const char *path, + svn_wc_notify_action_t action, + svn_node_kind_t kind, + const char *mime_type, + svn_wc_notify_state_t content_state, + svn_wc_notify_state_t prop_state, + svn_revnum_t revision); /** * @see svn::ContextListener */ virtual bool - contextGetLogMessage (std::string & msg); + contextGetLogMessage(std::string & msg); /** * @see svn::ContextListener */ virtual svn::ContextListener::SslServerTrustAnswer - contextSslServerTrustPrompt ( + contextSslServerTrustPrompt( const svn::ContextListener::SslServerTrustData & data, apr_uint32_t & acceptedFailures); @@ -138,21 +138,21 @@ class Listener : public svn::ContextListener * @see svn::ContextListener */ virtual bool - contextSslClientCertPrompt (std::string & certFile); + contextSslClientCertPrompt(std::string & certFile); /** * @see svn::ContextListener */ virtual bool - contextSslClientCertPwPrompt (std::string & password, - const std::string & realm, - bool & maySave); + contextSslClientCertPwPrompt(std::string & password, + const std::string & realm, + bool & maySave); /** * @see svn::ContextListener */ virtual bool - contextCancel (); + contextCancel(); /** * shall the ongoing operation be cancelled? @@ -164,7 +164,7 @@ class Listener : public svn::ContextListener * @li false dont cancel */ void - cancel (bool value); + cancel(bool value); /** * @see cancel @@ -173,7 +173,7 @@ class Listener : public svn::ContextListener * @retval false dont cancel */ bool - isCancelled () const; + isCancelled() const; /** * handles @a event that is passed from the parent frame @@ -182,11 +182,11 @@ class Listener : public svn::ContextListener * @param event forwarded event */ void - handleEvent (wxCommandEvent & event); + handleEvent(wxCommandEvent & event); protected: - void Trace (const wxString & msg); + void Trace(const wxString & msg); private: // implementation specific data @@ -196,12 +196,12 @@ class Listener : public svn::ContextListener /** * disable private default constructor */ - Listener (); + Listener(); /** * disable private copy constructor */ - Listener (const Listener &); + Listener(const Listener &); }; #endif diff --git a/src/lock_action.cpp b/src/lock_action.cpp index b909b01d..365bef5a 100644 --- a/src/lock_action.cpp +++ b/src/lock_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,50 +36,50 @@ #include "utils.hpp" -LockAction::LockAction (wxWindow * parent) - : Action (parent, _("Lock")) +LockAction::LockAction(wxWindow * parent) + : Action(parent, _("Lock")) { } bool -LockAction::Prepare () +LockAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - LockDlg dlg(GetParent ()); + LockDlg dlg(GetParent()); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - m_stealLock = dlg.GetStealLock (); - m_message = dlg.GetMessage (); + m_stealLock = dlg.GetStealLock(); + m_message = dlg.GetMessage(); return true; } bool -LockAction::Perform () +LockAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); - std::string messageUtf8 (LocalToUtf8 (m_message)); - client.lock (GetTargets (), m_stealLock, messageUtf8.c_str ()); + std::string messageUtf8(LocalToUtf8(m_message)); + client.lock(GetTargets(), m_stealLock, messageUtf8.c_str()); return true; } bool -LockAction::CheckStatusSel (const svn::StatusSel & statusSel) +LockAction::CheckStatusSel(const svn::StatusSel & statusSel) { - if (0 == statusSel.size ()) + if (0 == statusSel.size()) return false; - if (statusSel.hasUnversioned ()) + if (statusSel.hasUnversioned()) return false; return true; diff --git a/src/lock_action.hpp b/src/lock_action.hpp index 3980716a..b063199a 100644 --- a/src/lock_action.hpp +++ b/src/lock_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,24 +36,24 @@ namespace svn class LockAction : public Action { public: - LockAction (wxWindow * parent); + LockAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: bool m_stealLock; wxString m_message; // hide default and copy constructor - LockAction (); - LockAction (const LockAction &); + LockAction(); + LockAction(const LockAction &); }; #endif diff --git a/src/lock_dlg.cpp b/src/lock_dlg.cpp index e64691cb..808f3aad 100644 --- a/src/lock_dlg.cpp +++ b/src/lock_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,87 +37,87 @@ struct LockDlg::Data wxString message; - Data (wxWindow * window) - : stealLock (false), msg (0) + Data(wxWindow * window) + : stealLock(false), msg(0) { // create controls wxStaticBox* msgBox = new wxStaticBox(window, 1, _("Enter a comment for this lock")); - wxSize msgSize (window->GetCharWidth () * 80, - window->GetCharHeight () * 4); + wxSize msgSize(window->GetCharWidth() * 80, + window->GetCharHeight() * 4); - msg = new wxTextCtrl (window, -1, wxEmptyString, wxDefaultPosition, - msgSize, wxTE_MULTILINE, - wxTextValidator(wxFILTER_NONE, &message)); + msg = new wxTextCtrl(window, -1, wxEmptyString, wxDefaultPosition, + msgSize, wxTE_MULTILINE, + wxTextValidator(wxFILTER_NONE, &message)); wxCheckBox * checkStealLock = NULL; - wxGenericValidator val (&stealLock); + wxGenericValidator val(&stealLock); checkStealLock = - new wxCheckBox (window, -1, _("Steal lock if it belongs to another user"), - wxDefaultPosition, wxDefaultSize, 0, - val); - wxButton * ok = new wxButton (window, wxID_OK, _("OK" )); - wxButton * cancel = new wxButton (window, wxID_CANCEL, _("Cancel")); + new wxCheckBox(window, -1, _("Steal lock if it belongs to another user"), + wxDefaultPosition, wxDefaultSize, 0, + val); + wxButton * ok = new wxButton(window, wxID_OK, _("OK")); + wxButton * cancel = new wxButton(window, wxID_CANCEL, _("Cancel")); // position controls wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); // The message field: wxStaticBoxSizer * msgSizer = - new wxStaticBoxSizer (msgBox, wxHORIZONTAL); - msgSizer->Add (msg, 1, wxALL | wxEXPAND, 5); + new wxStaticBoxSizer(msgBox, wxHORIZONTAL); + msgSizer->Add(msg, 1, wxALL | wxEXPAND, 5); // The buttons: - wxBoxSizer * buttonSizer = new wxBoxSizer (wxHORIZONTAL); - buttonSizer->Add (checkStealLock, 1, - wxALL | wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT, - 10); - buttonSizer->Add (ok, 0, wxALL, 10); - buttonSizer->Add (cancel, 0, wxALL, 10); + wxBoxSizer * buttonSizer = new wxBoxSizer(wxHORIZONTAL); + buttonSizer->Add(checkStealLock, 1, + wxALL | wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT, + 10); + buttonSizer->Add(ok, 0, wxALL, 10); + buttonSizer->Add(cancel, 0, wxALL, 10); - wxBoxSizer * topSizer = new wxBoxSizer (wxHORIZONTAL); - topSizer->Add (msgSizer, 1, wxALL | wxEXPAND, 5); + wxBoxSizer * topSizer = new wxBoxSizer(wxHORIZONTAL); + topSizer->Add(msgSizer, 1, wxALL | wxEXPAND, 5); // Add all the sizers to the main sizer - mainSizer->Add (topSizer, 1, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (buttonSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(topSizer, 1, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(buttonSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); - window->SetAutoLayout (true); - window->SetSizer (mainSizer); + window->SetAutoLayout(true); + window->SetSizer(mainSizer); - mainSizer->SetSizeHints (window); - mainSizer->Fit (window); + mainSizer->SetSizeHints(window); + mainSizer->Fit(window); - ok->SetDefault (); + ok->SetDefault(); } }; -BEGIN_EVENT_TABLE (LockDlg, wxDialog) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(LockDlg, wxDialog) +END_EVENT_TABLE() -LockDlg::LockDlg (wxWindow * parent) - : wxDialog(parent, -1, _("Lock"), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +LockDlg::LockDlg(wxWindow * parent) + : wxDialog(parent, -1, _("Lock"), + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - m = new Data (this); - CentreOnParent (); + m = new Data(this); + CentreOnParent(); } -LockDlg::~LockDlg () +LockDlg::~LockDlg() { delete m; } const wxString & -LockDlg::GetMessage () const +LockDlg::GetMessage() const { return m->message; } bool -LockDlg::GetStealLock () const +LockDlg::GetStealLock() const { return m->stealLock; } diff --git a/src/lock_dlg.hpp b/src/lock_dlg.hpp index a521b7c6..619e3f04 100644 --- a/src/lock_dlg.hpp +++ b/src/lock_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -41,28 +41,28 @@ class LockDlg : public wxDialog /** * destructor */ - virtual ~LockDlg (); + virtual ~LockDlg(); /** * @return log message */ const wxString & - GetMessage () const; + GetMessage() const; /** * @return stealLock setting */ bool - GetStealLock () const; + GetStealLock() const; private: /** hide implementation details */ struct Data; Data * m; - void OnHistoryComboBox (wxCommandEvent &); + void OnHistoryComboBox(wxCommandEvent &); private: - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/log_action.cpp b/src/log_action.cpp index 3369c7e5..4ff9ac7e 100644 --- a/src/log_action.cpp +++ b/src/log_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,34 +37,34 @@ #include "log_action.hpp" #include "log_data.hpp" -LogAction::LogAction (wxWindow * parent) - : Action (parent, _("Log"), DONT_UPDATE) +LogAction::LogAction(wxWindow * parent) + : Action(parent, _("Log"), DONT_UPDATE) { } bool -LogAction::Perform () +LogAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); + + svn::Path target = GetTarget(); + const svn::LogEntries * entries = + client.log(target.c_str(), svn::Revision::START, + svn::Revision::HEAD, true, false); + + LogData * data = new LogData(entries, target); + ActionEvent::Post(GetParent(), TOKEN_LOG, data); - svn::Path target = GetTarget (); - const svn::LogEntries * entries = - client.log (target.c_str (), svn::Revision::START, - svn::Revision::HEAD, true, false); - - LogData * data = new LogData (entries, target); - ActionEvent::Post (GetParent (), TOKEN_LOG, data); - return true; } bool -LogAction::CheckStatusSel (const svn::StatusSel & statusSel) +LogAction::CheckStatusSel(const svn::StatusSel & statusSel) { - if (1 != statusSel.size ()) + if (1 != statusSel.size()) return false; - if (statusSel.hasUnversioned ()) + if (statusSel.hasUnversioned()) return false; return true; diff --git a/src/log_action.hpp b/src/log_action.hpp index 04e1ddad..3e6eee6e 100644 --- a/src/log_action.hpp +++ b/src/log_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,16 +37,16 @@ namespace svn class LogAction : public Action { public: - LogAction (wxWindow * parent); + LogAction(wxWindow * parent); /** * @see Action */ - virtual bool - Perform (); + virtual bool + Perform(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); }; #endif diff --git a/src/log_data.hpp b/src/log_data.hpp index 1894b70e..1d619489 100644 --- a/src/log_data.hpp +++ b/src/log_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,8 +37,8 @@ struct LogData const svn::LogEntries * logEntries; svn::Path target; - LogData (const svn::LogEntries * logEntries_, const svn::Path & target_) - : logEntries (logEntries_), target (target_) + LogData(const svn::LogEntries * logEntries_, const svn::Path & target_) + : logEntries(logEntries_), target(target_) { } }; diff --git a/src/log_dlg.cpp b/src/log_dlg.cpp index 9d3951ff..2e6671c5 100644 --- a/src/log_dlg.cpp +++ b/src/log_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -58,17 +58,17 @@ enum class LogList : public wxListCtrl { public: - LogList (wxWindow * parent, const svn::LogEntries * entries) - : wxListCtrl (parent, LOG_LIST, wxDefaultPosition, - wxSize (365, 150), wxLC_REPORT) + LogList(wxWindow * parent, const svn::LogEntries * entries) + : wxListCtrl(parent, LOG_LIST, wxDefaultPosition, + wxSize(365, 150), wxLC_REPORT) { - InitializeList (entries); - CentreOnParent (); + InitializeList(entries); + CentreOnParent(); } - virtual ~LogList () + virtual ~LogList() { - DeleteAllItems (); + DeleteAllItems(); } /** @@ -79,18 +79,18 @@ class LogList : public wxListCtrl * @retval -1 not found/error */ svn_revnum_t - GetRevisionForItem (long item) const + GetRevisionForItem(long item) const { wxListItem info; info.m_itemId = item; info.m_col = 0; info.m_mask = wxLIST_MASK_TEXT; - - if (!GetItem (info)) + + if (!GetItem(info)) return -1; svn_revnum_t revnum=-1; - info.m_text.ToLong (&revnum); + info.m_text.ToLong(&revnum); return revnum; } @@ -99,44 +99,44 @@ class LogList : public wxListCtrl * * @return selected revision * @retval -1 if nothing was selected or the cell - * contains an invalid string + * contains an invalid string */ svn_revnum_t - GetSelectedRevision () const + GetSelectedRevision() const { - long item = GetNextItem (-1, wxLIST_NEXT_ALL, - wxLIST_STATE_SELECTED); + long item = GetNextItem(-1, wxLIST_NEXT_ALL, + wxLIST_STATE_SELECTED); if (item == -1) return -1; - return GetRevisionForItem (item); + return GetRevisionForItem(item); } /** * returns the selected revisions. - * Like @a GetSelectedRevision, but can return + * Like @a GetSelectedRevision, but can return * more revisions at once. * * @return if nothing is selected, an empty array * will be returned */ RevnumArray - GetSelectedRevisions () const + GetSelectedRevisions() const { RevnumArray array; long item = -1; do { - item = GetNextItem (item, wxLIST_NEXT_ALL, - wxLIST_STATE_SELECTED); + item = GetNextItem(item, wxLIST_NEXT_ALL, + wxLIST_STATE_SELECTED); if (item != -1) { - svn_revnum_t revnum (GetRevisionForItem (item)); + svn_revnum_t revnum(GetRevisionForItem(item)); - array.Add (revnum); + array.Add(revnum); } - } + } while (item != -1); return array; @@ -144,55 +144,55 @@ class LogList : public wxListCtrl void - DeleteAllItems () + DeleteAllItems() { // Delete the item data before deleting the items: - while (GetItemCount () > 0) - DeleteItem (0); + while (GetItemCount() > 0) + DeleteItem(0); - wxListCtrl::DeleteAllItems (); + wxListCtrl::DeleteAllItems(); } private: - void OnSelected (wxListEvent& event); + void OnSelected(wxListEvent& event); - void InitializeList (const svn::LogEntries * entries) + void InitializeList(const svn::LogEntries * entries) { - SetSingleStyle (wxLC_REPORT); + SetSingleStyle(wxLC_REPORT); - InsertColumn (0, _("Revision")); - InsertColumn (1, _("User")); - InsertColumn (2, _("Date")); - InsertColumn (3, _("Log Message")); + InsertColumn(0, _("Revision")); + InsertColumn(1, _("User")); + InsertColumn(2, _("Date")); + InsertColumn(3, _("Log Message")); - SetColumnWidth (0, 65); - SetColumnWidth (1, 100); - SetColumnWidth (2, 150); - SetColumnWidth (3, 200); + SetColumnWidth(0, 65); + SetColumnWidth(1, 100); + SetColumnWidth(2, 150); + SetColumnWidth(3, 200); if (entries == 0) return; long index=0; svn::LogEntries::const_iterator it; - for (it=entries->begin (); it != entries->end (); it++ ) + for (it=entries->begin(); it != entries->end(); it++) { const svn::LogEntry & entry = *it; wxString rev; - wxString dateStr (FormatDateTime (entry.date)); + wxString dateStr(FormatDateTime(entry.date)); - rev.Printf (wxT("%ld"), (long) entry.revision); + rev.Printf(wxT("%ld"), (long) entry.revision); - InsertItem (index, rev); - SetItem (index, 1, Utf8ToLocal (entry.author.c_str ())); - SetItem (index, 2, dateStr); - SetItem (index, 3, NewLinesToSpaces (Utf8ToLocal (entry.message.c_str ()))); + InsertItem(index, rev); + SetItem(index, 1, Utf8ToLocal(entry.author.c_str())); + SetItem(index, 2, dateStr); + SetItem(index, 3, NewLinesToSpaces(Utf8ToLocal(entry.message.c_str()))); index++; } } - wxString - NewLinesToSpaces (const wxString& str) + wxString + NewLinesToSpaces(const wxString& str) { /* wxString result = str; @@ -201,15 +201,15 @@ class LogList : public wxListCtrl */ wxString result; - if (str.Length () == 0) + if (str.Length() == 0) { return result; } - result.Alloc (str.Length ()); + result.Alloc(str.Length()); wxChar last = 0; - for (size_t idx = 0; idx < str.Length (); idx++) + for (size_t idx = 0; idx < str.Length(); idx++) { switch (str[idx]) { @@ -235,65 +235,65 @@ class LogList : public wxListCtrl class AffectedList : public wxListCtrl { public: - AffectedList (wxWindow * parent) - : wxListCtrl (parent, -1, wxDefaultPosition, - wxSize (365, 150), wxLC_REPORT) + AffectedList(wxWindow * parent) + : wxListCtrl(parent, -1, wxDefaultPosition, + wxSize(365, 150), wxLC_REPORT) { - InsertColumn (0, _("Action")); - InsertColumn (1, _("Path")); - InsertColumn (2, _("Copied from Path")); - InsertColumn (3, _("Copied from Rev")); - - CentreOnParent (); + InsertColumn(0, _("Action")); + InsertColumn(1, _("Path")); + InsertColumn(2, _("Copied from Path")); + InsertColumn(3, _("Copied from Rev")); + + CentreOnParent(); } - virtual ~AffectedList () + virtual ~AffectedList() { - DeleteAllItems (); + DeleteAllItems(); } void - DeleteAllItems () + DeleteAllItems() { // Delete the item data before deleting the items: - while (GetItemCount () > 0) - DeleteItem (0); + while (GetItemCount() > 0) + DeleteItem(0); - wxListCtrl::DeleteAllItems (); + wxListCtrl::DeleteAllItems(); } - - void SetValue (const std::list & changedPaths) + + void SetValue(const std::list & changedPaths) { - DeleteAllItems (); + DeleteAllItems(); int i=0; char actionBuffer [2]; actionBuffer [1] = 0; std::list::const_iterator it; - for (it=changedPaths.begin (); it!=changedPaths.end (); it++) + for (it=changedPaths.begin(); it!=changedPaths.end(); it++) { const svn::LogChangePathEntry & changedPath = *it; actionBuffer [0] = changedPath.action; - - wxString label (Utf8ToLocal (actionBuffer)); - wxString copyFromRev (wxEmptyString); + + wxString label(Utf8ToLocal(actionBuffer)); + wxString copyFromRev(wxEmptyString); if (changedPath.copyFromRevision != -1) - copyFromRev.Printf (wxT("%ld"), changedPath.copyFromRevision); + copyFromRev.Printf(wxT("%ld"), changedPath.copyFromRevision); - InsertItem (i, label); - SetItem (i, 1, Utf8ToLocal (changedPath.path.c_str ())); - SetItem (i, 2, Utf8ToLocal (changedPath.copyFromPath.c_str ())); - SetItem (i, 3, copyFromRev); + InsertItem(i, label); + SetItem(i, 1, Utf8ToLocal(changedPath.path.c_str())); + SetItem(i, 2, Utf8ToLocal(changedPath.copyFromPath.c_str())); + SetItem(i, 3, copyFromRev); i++; } // now refresh the column width - i=GetColumnCount (); + i=GetColumnCount(); while (i-- > 0) - SetColumnWidth (i, (i == 0) ? wxLIST_AUTOSIZE_USEHEADER : wxLIST_AUTOSIZE); + SetColumnWidth(i, (i == 0) ? wxLIST_AUTOSIZE_USEHEADER : wxLIST_AUTOSIZE); } }; @@ -317,78 +317,78 @@ struct LogDlg::Data wxNotebook * m_notebook; public: - Data (wxWindow * parent_, - wxWindow * wnd, - const char * path_, - const svn::LogEntries * entries_) - : entries (entries_), path (Utf8ToLocal (path_)), - parent (parent_), window (wnd) + Data(wxWindow * parent_, + wxWindow * wnd, + const char * path_, + const svn::LogEntries * entries_) + : entries(entries_), path(Utf8ToLocal(path_)), + parent(parent_), window(wnd) { // create controls - wxSplitterWindow* splitterWindow = new wxSplitterWindow (wnd, -1, wxDefaultPosition, wxDefaultSize, 0); - wxPanel* topPanel = new wxPanel (splitterWindow, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); + wxSplitterWindow* splitterWindow = new wxSplitterWindow(wnd, -1, wxDefaultPosition, wxDefaultSize, 0); + wxPanel* topPanel = new wxPanel(splitterWindow, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); wxPanel* bottomPanel = new wxPanel(splitterWindow, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); wxString history; - history.Printf (_("History: %d revisions"), entries->size ()); - wxStaticText * historyLabel = new wxStaticText (topPanel, -1, history); - - m_logList = new LogList (topPanel, entries); - - m_notebook = new wxNotebook (bottomPanel, -1); - m_logMsg = new wxTextCtrl (m_notebook, LOG_MSG, wxEmptyString, - wxDefaultPosition, wxSize (420, 210), - wxTE_READONLY | wxTE_MULTILINE ); - m_notebook->AddPage (m_logMsg, _("Log Message:")); - m_affectedList = new AffectedList (m_notebook); - m_notebook->AddPage (m_affectedList, _("Affected Files/Dirs")); - - wxButton * buttonClose = new wxButton (topPanel, wxID_OK, _("&Close")); - m_buttonView = new wxButton (topPanel, ID_View, _("&View")); - m_buttonGet = new wxButton (topPanel, ID_Get, _("&Get")); - m_buttonDiff = new wxButton (topPanel, ID_Diff, _("&Diff")); - m_buttonMerge = new wxButton (topPanel, ID_Merge, _("&Merge")); - m_buttonAnnotate = new wxButton (topPanel, ID_Annotate, _("&Annotate")); + history.Printf(_("History: %d revisions"), entries->size()); + wxStaticText * historyLabel = new wxStaticText(topPanel, -1, history); + + m_logList = new LogList(topPanel, entries); + + m_notebook = new wxNotebook(bottomPanel, -1); + m_logMsg = new wxTextCtrl(m_notebook, LOG_MSG, wxEmptyString, + wxDefaultPosition, wxSize(420, 210), + wxTE_READONLY | wxTE_MULTILINE); + m_notebook->AddPage(m_logMsg, _("Log Message:")); + m_affectedList = new AffectedList(m_notebook); + m_notebook->AddPage(m_affectedList, _("Affected Files/Dirs")); + + wxButton * buttonClose = new wxButton(topPanel, wxID_OK, _("&Close")); + m_buttonView = new wxButton(topPanel, ID_View, _("&View")); + m_buttonGet = new wxButton(topPanel, ID_Get, _("&Get")); + m_buttonDiff = new wxButton(topPanel, ID_Diff, _("&Diff")); + m_buttonMerge = new wxButton(topPanel, ID_Merge, _("&Merge")); + m_buttonAnnotate = new wxButton(topPanel, ID_Annotate, _("&Annotate")); // View/Get/Diff disabled for Alpha 3 Milestone - m_buttonView ->Enable (false); - m_buttonGet ->Enable (false); - m_buttonDiff ->Enable (false); - m_buttonMerge->Enable (false); - m_buttonAnnotate->Enable (false); + m_buttonView ->Enable(false); + m_buttonGet ->Enable(false); + m_buttonDiff ->Enable(false); + m_buttonMerge->Enable(false); + m_buttonAnnotate->Enable(false); // position controls - wxBoxSizer * logSizer = new wxBoxSizer (wxVERTICAL); - logSizer->Add (historyLabel, 0, wxALL, 5); - logSizer->Add (m_logList, 1, wxLEFT | wxEXPAND); - - wxBoxSizer * buttonSizer = new wxBoxSizer (wxVERTICAL); - buttonSizer->Add (buttonClose, 0, wxALL | wxEXPAND, 5); - buttonSizer->Add (m_buttonView, 0, wxALL | wxEXPAND, 5); - buttonSizer->Add (m_buttonGet, 0, wxALL | wxEXPAND, 5); - buttonSizer->Add (m_buttonDiff, 0, wxALL | wxEXPAND, 5); - buttonSizer->Add (m_buttonMerge, 0, wxALL | wxEXPAND, 5); - buttonSizer->Add (m_buttonAnnotate, 0, wxALL | wxEXPAND, 5); - - wxBoxSizer * topSizer = new wxBoxSizer (wxHORIZONTAL); - topSizer->Add (logSizer, 1, wxEXPAND | wxALL, 5); - topSizer->Add (buttonSizer, 0, wxALL, 5); - - wxBoxSizer * mainSizer = new wxBoxSizer (wxVERTICAL); - topPanel->SetSizerAndFit (topSizer); - wxBoxSizer * bottomSizer = new wxBoxSizer (wxHORIZONTAL); - bottomSizer->Add (m_notebook, 1, wxALL | wxEXPAND, 5); - bottomPanel->SetSizerAndFit (bottomSizer); - splitterWindow->SplitHorizontally (topPanel, bottomPanel, -100); - splitterWindow->SetSashGravity (0.5); - mainSizer->Add (splitterWindow, 1, wxEXPAND, 0); - - wnd->SetAutoLayout (true); - wnd->SetSizer (mainSizer); - - mainSizer->SetSizeHints (wnd); - mainSizer->Fit (wnd); + wxBoxSizer * logSizer = new wxBoxSizer(wxVERTICAL); + logSizer->Add(historyLabel, 0, wxALL, 5); + logSizer->Add(m_logList, 1, wxLEFT | wxEXPAND); + + wxBoxSizer * buttonSizer = new wxBoxSizer(wxVERTICAL); + buttonSizer->Add(buttonClose, 0, wxALL | wxEXPAND, 5); + buttonSizer->Add(m_buttonView, 0, wxALL | wxEXPAND, 5); + buttonSizer->Add(m_buttonGet, 0, wxALL | wxEXPAND, 5); + buttonSizer->Add(m_buttonDiff, 0, wxALL | wxEXPAND, 5); + buttonSizer->Add(m_buttonMerge, 0, wxALL | wxEXPAND, 5); + buttonSizer->Add(m_buttonAnnotate, 0, wxALL | wxEXPAND, 5); + + wxBoxSizer * topSizer = new wxBoxSizer(wxHORIZONTAL); + topSizer->Add(logSizer, 1, wxEXPAND | wxALL, 5); + topSizer->Add(buttonSizer, 0, wxALL, 5); + + wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); + topPanel->SetSizerAndFit(topSizer); + wxBoxSizer * bottomSizer = new wxBoxSizer(wxHORIZONTAL); + bottomSizer->Add(m_notebook, 1, wxALL | wxEXPAND, 5); + bottomPanel->SetSizerAndFit(bottomSizer); + splitterWindow->SplitHorizontally(topPanel, bottomPanel, -100); + splitterWindow->SetSashGravity(0.5); + mainSizer->Add(splitterWindow, 1, wxEXPAND, 0); + + wnd->SetAutoLayout(true); + wnd->SetSizer(mainSizer); + + mainSizer->SetSizeHints(wnd); + mainSizer->Fit(wnd); } /** @@ -396,93 +396,93 @@ struct LogDlg::Data * @a CheckButtons makes sure this command will * only be enabled if one entry in the list is * selected - */ + */ void - OnGet () + OnGet() { - svn_revnum_t revnum = m_logList->GetSelectedRevision (); + svn_revnum_t revnum = m_logList->GetSelectedRevision(); - GetData * data = new GetData (); + GetData * data = new GetData(); data->revision = revnum; data->path = path; - ActionEvent::Post (parent, TOKEN_GET, data); + ActionEvent::Post(parent, TOKEN_GET, data); } /** * handle the "View" button */ void - OnView () + OnView() { - svn_revnum_t revnum = m_logList->GetSelectedRevision (); - - GetData * data = new GetData (); + svn_revnum_t revnum = m_logList->GetSelectedRevision(); + + GetData * data = new GetData(); data->revision = revnum; data->path = path; - ActionEvent::Post (parent, TOKEN_VIEW, data); + ActionEvent::Post(parent, TOKEN_VIEW, data); } - + void - OnSelected (long index) + OnSelected(long index) { const svn::LogEntry & entry = (*entries)[index]; - wxString message (Utf8ToLocal (entry.message.c_str ())); - message.Trim (); + wxString message(Utf8ToLocal(entry.message.c_str())); + message.Trim(); - m_logMsg->SetValue (message); + m_logMsg->SetValue(message); - m_affectedList->SetValue (entry.changedPaths); + m_affectedList->SetValue(entry.changedPaths); - CheckButtons (); + CheckButtons(); } void - OnDiff () + OnDiff() { - RevnumArray array (m_logList->GetSelectedRevisions ()); + RevnumArray array(m_logList->GetSelectedRevisions()); DiffData * data = 0; - if (array.Count () == 2) + if (array.Count() == 2) { - data = new DiffData (); + data = new DiffData(); data->path = path; data->compareType = DiffData::TWO_REVISIONS; - data->revision1 = svn::Revision (array[0]); - data->revision2 = svn::Revision (array[1]); + data->revision1 = svn::Revision(array[0]); + data->revision2 = svn::Revision(array[1]); } - else if (array.Count () == 1) + else if (array.Count() == 1) { - data = new DiffData (); + data = new DiffData(); data->path = path; data->compareType = DiffData::WITH_DIFFERENT_REVISION; - data->revision1 = svn::Revision (array[0]); + data->revision1 = svn::Revision(array[0]); } else { - wxMessageBox (_("Invalid selection. At least one revisions is needed for diff and no more than two."), - _("Error"), wxOK | wxICON_ERROR, parent); + wxMessageBox(_("Invalid selection. At least one revisions is needed for diff and no more than two."), + _("Error"), wxOK | wxICON_ERROR, parent); return; } - ActionEvent::Post (parent, TOKEN_DIFF, data); + ActionEvent::Post(parent, TOKEN_DIFF, data); } void - OnMerge () + OnMerge() { - RevnumArray array (m_logList->GetSelectedRevisions ()); + RevnumArray array(m_logList->GetSelectedRevisions()); - if (array.Count () != 2) + if (array.Count() != 2) { - wxMessageBox (_("Invalid selection. Exactly two revisions needed for merge."), - _("Error"), wxOK | wxICON_ERROR, parent); + wxMessageBox(_("Invalid selection. Exactly two revisions needed for merge."), + _("Error"), wxOK | wxICON_ERROR, parent); return; } - MergeData * data = new MergeData (); + MergeData * data = new MergeData(); data->Path1 = path; data->Path2 = path; if (array[0] > array[1]) @@ -496,112 +496,112 @@ struct LogDlg::Data data->Path2Rev << array[1]; } - ActionEvent::Post (parent, TOKEN_MERGE, data); + ActionEvent::Post(parent, TOKEN_MERGE, data); } void - OnAnnotate () + OnAnnotate() { - RevnumArray array (m_logList->GetSelectedRevisions ()); + RevnumArray array(m_logList->GetSelectedRevisions()); AnnotateData * data = 0; - if (array.Count () == 1) + if (array.Count() == 1) { - data = new AnnotateData (); + data = new AnnotateData(); data->path = path; - data->endRevision = svn::Revision (array[0]); + data->endRevision = svn::Revision(array[0]); } else { - wxMessageBox (_("Invalid selection. Only one revision may be selected for annotate"), - _("Error"), wxOK | wxICON_ERROR, parent); + wxMessageBox(_("Invalid selection. Only one revision may be selected for annotate"), + _("Error"), wxOK | wxICON_ERROR, parent); return; } - ActionEvent::Post (parent, TOKEN_ANNOTATE, data); + ActionEvent::Post(parent, TOKEN_ANNOTATE, data); } - void - CheckButtons () + void + CheckButtons() { - svn::Path pathUtf8 (PathUtf8 (path)); - bool isUrl = pathUtf8.isUrl (); - int count = m_logList->GetSelectedItemCount (); + svn::Path pathUtf8(PathUtf8(path)); + bool isUrl = pathUtf8.isUrl(); + int count = m_logList->GetSelectedItemCount(); - m_buttonGet ->Enable ((count == 1) && (!isUrl)); - m_buttonView ->Enable (count == 1); + m_buttonGet ->Enable((count == 1) && (!isUrl)); + m_buttonView ->Enable(count == 1); - // If the bookmark is a working copy, then we can + // If the bookmark is a working copy, then we can // compare a revision against the local copy if (isUrl) - m_buttonDiff ->Enable ((count == 2)); + m_buttonDiff ->Enable((count == 2)); else - m_buttonDiff ->Enable ((count == 1) || (count == 2)); + m_buttonDiff ->Enable((count == 1) || (count == 2)); - m_buttonMerge->Enable (count == 2); - m_buttonAnnotate->Enable (count == 1); + m_buttonMerge->Enable(count == 2); + m_buttonAnnotate->Enable(count == 1); } }; -BEGIN_EVENT_TABLE (LogDlg, wxDialog) - EVT_BUTTON (ID_Get, LogDlg::OnGet) - EVT_BUTTON (ID_View, LogDlg::OnView) - EVT_BUTTON (ID_Diff, LogDlg::OnDiff) - EVT_BUTTON (ID_Merge, LogDlg::OnMerge) - EVT_BUTTON (ID_Annotate, LogDlg::OnAnnotate) - EVT_LIST_ITEM_SELECTED (LOG_LIST, LogDlg::OnSelected) -END_EVENT_TABLE () - -LogDlg::LogDlg (wxWindow * parent, - const char * path, - const svn::LogEntries * entries) - : wxDialog (parent, -1, _("Log History"), wxDefaultPosition, - wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX) +BEGIN_EVENT_TABLE(LogDlg, wxDialog) + EVT_BUTTON(ID_Get, LogDlg::OnGet) + EVT_BUTTON(ID_View, LogDlg::OnView) + EVT_BUTTON(ID_Diff, LogDlg::OnDiff) + EVT_BUTTON(ID_Merge, LogDlg::OnMerge) + EVT_BUTTON(ID_Annotate, LogDlg::OnAnnotate) + EVT_LIST_ITEM_SELECTED(LOG_LIST, LogDlg::OnSelected) +END_EVENT_TABLE() + +LogDlg::LogDlg(wxWindow * parent, + const char * path, + const svn::LogEntries * entries) + : wxDialog(parent, -1, _("Log History"), wxDefaultPosition, + wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX) { - m = new Data (parent, this, path, entries); - CentreOnParent (); + m = new Data(parent, this, path, entries); + CentreOnParent(); } -LogDlg::~LogDlg () +LogDlg::~LogDlg() { delete m; } void -LogDlg::OnGet (wxCommandEvent & event) +LogDlg::OnGet(wxCommandEvent & event) { - m->OnGet (); + m->OnGet(); } void -LogDlg::OnView (wxCommandEvent & event) +LogDlg::OnView(wxCommandEvent & event) { - m->OnView (); + m->OnView(); } void -LogDlg::OnSelected (wxListEvent& event) +LogDlg::OnSelected(wxListEvent& event) { - m->OnSelected (event.m_itemIndex); + m->OnSelected(event.m_itemIndex); } void -LogDlg::OnDiff (wxCommandEvent & event) +LogDlg::OnDiff(wxCommandEvent & event) { - m->OnDiff (); + m->OnDiff(); } void -LogDlg::OnMerge (wxCommandEvent & event) +LogDlg::OnMerge(wxCommandEvent & event) { - m->OnMerge (); + m->OnMerge(); } void -LogDlg::OnAnnotate (wxCommandEvent & event) +LogDlg::OnAnnotate(wxCommandEvent & event) { - m->OnAnnotate (); + m->OnAnnotate(); } /* ----------------------------------------------------------------- diff --git a/src/log_dlg.hpp b/src/log_dlg.hpp index 167c08f9..475401e5 100644 --- a/src/log_dlg.hpp +++ b/src/log_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -47,14 +47,14 @@ class LogDlg : public wxDialog * @param path path of selected item * @param entries log entries */ - LogDlg (wxWindow * parent, - const char * path, - const svn::LogEntries * entries); + LogDlg(wxWindow * parent, + const char * path, + const svn::LogEntries * entries); /** * destructor */ - virtual ~LogDlg (); + virtual ~LogDlg(); private: /** hide implementation details */ @@ -66,14 +66,14 @@ class LogDlg : public wxDialog * Event handler for the "Get" button * @param event */ - void OnGet (wxCommandEvent & event); + void OnGet(wxCommandEvent & event); /** * Event handler for the "View" button * @param event */ - void OnView (wxCommandEvent & event); + void OnView(wxCommandEvent & event); /** @@ -82,30 +82,30 @@ class LogDlg : public wxDialog * * @param event */ - void OnSelected (wxListEvent& event); + void OnSelected(wxListEvent& event); /** * Event handler for the "Diff" button * @param event */ - void OnDiff (wxCommandEvent & event); + void OnDiff(wxCommandEvent & event); /** * Event handler for the "Merge" button * @param event */ - void OnMerge (wxCommandEvent & event); + void OnMerge(wxCommandEvent & event); /** * Event handler for the "Annotate" button * @param event */ - void OnAnnotate (wxCommandEvent & event); + void OnAnnotate(wxCommandEvent & event); - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/merge_action.cpp b/src/merge_action.cpp index 85c93953..f1a63a5a 100644 --- a/src/merge_action.cpp +++ b/src/merge_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,22 +34,22 @@ #include "merge_dlg.hpp" #include "utils.hpp" -MergeAction::MergeAction (wxWindow * parent) - : Action (parent, _("Merge")) +MergeAction::MergeAction(wxWindow * parent) + : Action(parent, _("Merge")) { m_data.calledByLogDlg = false; } -MergeAction::MergeAction (wxWindow * parent, MergeData & data) - : Action (parent, _("Merge")), m_data (data) +MergeAction::MergeAction(wxWindow * parent, MergeData & data) + : Action(parent, _("Merge")), m_data(data) { m_data.calledByLogDlg = true; } bool -MergeAction::Prepare () +MergeAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } @@ -59,11 +59,11 @@ MergeAction::Prepare () if (m_data.calledByLogDlg) m_data.Destination = m_data.Path1; else - m_data.Destination = Utf8ToLocal (GetPath().c_str()); + m_data.Destination = Utf8ToLocal(GetPath().c_str()); - MergeDlg dlg (GetParent (), m_data.calledByLogDlg, m_data); + MergeDlg dlg(GetParent(), m_data.calledByLogDlg, m_data); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } @@ -72,48 +72,48 @@ MergeAction::Prepare () } bool -MergeAction::Perform () +MergeAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); // Set current working directory to the path where the // merge will be performed. If Destination is a file and not a // directory, only the directory part should be used - wxFileName path (m_data.Destination); - if (!wxSetWorkingDirectory (path.GetPath (wxPATH_GET_VOLUME))) + wxFileName path(m_data.Destination); + if (!wxSetWorkingDirectory(path.GetPath(wxPATH_GET_VOLUME))) { wxString msg; msg.Printf(_("Could not set working directory to %s"), - path.GetPath (wxPATH_GET_VOLUME).c_str ()); - TraceError (msg); + path.GetPath(wxPATH_GET_VOLUME).c_str()); + TraceError(msg); return false; } svn_revnum_t rev1 = 0; svn_revnum_t rev2 = 0; - if (!m_data.Path1Rev.ToLong (&rev1) || !m_data.Path2Rev.ToLong (&rev2)) + if (!m_data.Path1Rev.ToLong(&rev1) || !m_data.Path2Rev.ToLong(&rev2)) { wxString msg = _("Invalid revision number detected"); - TraceError (msg); + TraceError(msg); return false; } - svn::Path path1Utf8 (PathUtf8 (m_data.Path1)); - svn::Path path2Utf8 (PathUtf8 (m_data.Path2)); - svn::Path destinationUtf8 (PathUtf8 (m_data.Destination)); - client.merge (path1Utf8, - rev1, - path2Utf8, - rev2, - destinationUtf8, - m_data.Force, - m_data.Recursive); + svn::Path path1Utf8(PathUtf8(m_data.Path1)); + svn::Path path2Utf8(PathUtf8(m_data.Path2)); + svn::Path destinationUtf8(PathUtf8(m_data.Destination)); + client.merge(path1Utf8, + rev1, + path2Utf8, + rev2, + destinationUtf8, + m_data.Force, + m_data.Recursive); return true; } bool -MergeAction::CheckStatusSel (const svn::StatusSel & statusSel) +MergeAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/merge_action.hpp b/src/merge_action.hpp index e16a42fa..904017c8 100644 --- a/src/merge_action.hpp +++ b/src/merge_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -40,7 +40,7 @@ namespace svn class MergeAction:public Action { public: - MergeAction (wxWindow * frame); + MergeAction(wxWindow * frame); /** * Constructor, that takes read configured @a MergeData @@ -49,16 +49,16 @@ class MergeAction:public Action * @param parent parent window * @param data merge data */ - MergeAction (wxWindow * frame, MergeData & data); + MergeAction(wxWindow * frame, MergeData & data); - virtual bool - Prepare (); + virtual bool + Prepare(); - virtual bool - Perform (); + virtual bool + Perform(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: MergeData m_data; diff --git a/src/merge_data.hpp b/src/merge_data.hpp index 9563259d..b69adf69 100644 --- a/src/merge_data.hpp +++ b/src/merge_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -29,7 +29,7 @@ struct MergeData { - MergeData () + MergeData() { Recursive = true; Force = false; diff --git a/src/merge_dlg.cpp b/src/merge_dlg.cpp index 3c6268e1..bdd25a98 100644 --- a/src/merge_dlg.cpp +++ b/src/merge_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,60 +35,60 @@ enum ID_BUTTON_BROWSE, }; -BEGIN_EVENT_TABLE (MergeDlg, wxDialog) - EVT_BUTTON (wxID_OK, MergeDlg::OnOK) - EVT_BUTTON (ID_BUTTON_BROWSE, MergeDlg::OnBrowse) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(MergeDlg, wxDialog) + EVT_BUTTON(wxID_OK, MergeDlg::OnOK) + EVT_BUTTON(ID_BUTTON_BROWSE, MergeDlg::OnBrowse) +END_EVENT_TABLE() int -MergeDlg::TestRev (wxString & val) +MergeDlg::TestRev(wxString & val) { unsigned long rev = 0; - if (!val.ToULong (&rev, 10) && rev < 0) + if (!val.ToULong(&rev, 10) && rev < 0) { // could not convert revision to a number - wxMessageBox (_("Revision must be an unsigned number!"), - _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + wxMessageBox(_("Revision must be an unsigned number!"), + _("Error"), wxOK | wxCENTRE | wxICON_ERROR); return -1; } return 0; } -MergeDlg::MergeDlg (wxWindow * parent, bool calledByLogDlg, MergeData & data) - : wxDialog (parent, -1, _("Merge revisions"), wxDefaultPosition, - wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), - m_data(data) +MergeDlg::MergeDlg(wxWindow * parent, bool calledByLogDlg, MergeData & data) + : wxDialog(parent, -1, _("Merge revisions"), wxDefaultPosition, + wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), + m_data(data) { m_data.calledByLogDlg = calledByLogDlg; - InitializeData (); + InitializeData(); CentreOnParent(); } void -MergeDlg::OnOK (wxCommandEvent & event) +MergeDlg::OnOK(wxCommandEvent & event) { // Transfer data from controls into m_pData: TransferDataFromWindow(); - TrimString (m_data.Path1); - TrimString (m_data.Path1Rev); - TrimString (m_data.Path2); - TrimString (m_data.Path2Rev); - TrimString (m_data.Destination); + TrimString(m_data.Path1); + TrimString(m_data.Path1Rev); + TrimString(m_data.Path2); + TrimString(m_data.Path2Rev); + TrimString(m_data.Destination); // test revision numbers - if (TestRev (m_data.Path1Rev) < 0) + if (TestRev(m_data.Path1Rev) < 0) return; - if (TestRev (m_data.Path2Rev) < 0) + if (TestRev(m_data.Path2Rev) < 0) return; - if (m_data.Path1.IsEmpty ()) + if (m_data.Path1.IsEmpty()) { - wxMessageBox (_("First path or URL is required for merge!"), - _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + wxMessageBox(_("First path or URL is required for merge!"), + _("Error"), wxOK | wxCENTRE | wxICON_ERROR); // Do not allow the user to continue if the path is empty // and the import is addressing a file. @@ -97,14 +97,14 @@ MergeDlg::OnOK (wxCommandEvent & event) // If start revision for first path is emtpy... // (the end revision should be empty also in this case - checked above) - if (m_data.Path1Rev.IsEmpty ()) + if (m_data.Path1Rev.IsEmpty()) { // the second path should be specified, as now there is // no deductible interval from the first path - if (m_data.Path2.IsEmpty ()) + if (m_data.Path2.IsEmpty()) { - wxMessageBox (_("Second path or URL is required for merge!"), - _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + wxMessageBox(_("Second path or URL is required for merge!"), + _("Error"), wxOK | wxCENTRE | wxICON_ERROR); // Do not allow the user to continue if the path is empty // and the import is addressing a file. @@ -112,140 +112,140 @@ MergeDlg::OnOK (wxCommandEvent & event) } } - wxDialog::EndModal (wxID_OK); + wxDialog::EndModal(wxID_OK); } void -MergeDlg::InitializeData () +MergeDlg::InitializeData() { wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); // Merge paths grid: wxStaticBoxSizer * mergeSizer = new wxStaticBoxSizer( - new wxStaticBox (this, -1, _("Merge")), wxHORIZONTAL); + new wxStaticBox(this, -1, _("Merge")), wxHORIZONTAL); - wxFlexGridSizer * grid = new wxFlexGridSizer (6, 2, 0, 0); - grid->AddGrowableCol (0); // The first column can be expanded. + wxFlexGridSizer * grid = new wxFlexGridSizer(6, 2, 0, 0); + grid->AddGrowableCol(0); // The first column can be expanded. // Row 0: - grid->Add (new wxStaticText (this, -1, _("First working copy or URL")), 0, - 0, 5); - grid->Add (new wxStaticText (this, -1, _("Revision")), 0, - wxLEFT | wxALIGN_CENTER_VERTICAL, 20); + grid->Add(new wxStaticText(this, -1, _("First working copy or URL")), 0, + 0, 5); + grid->Add(new wxStaticText(this, -1, _("Revision")), 0, + wxLEFT | wxALIGN_CENTER_VERTICAL, 20); // Row 1: - wxTextCtrl *Path1 = new wxTextCtrl (this, -1, wxEmptyString, - wxDefaultPosition, wxSize (300, -1), 0, - wxTextValidator (wxFILTER_NONE, &m_data.Path1)); - grid->Add (Path1, 1, wxBOTTOM | wxEXPAND, 10); + wxTextCtrl *Path1 = new wxTextCtrl(this, -1, wxEmptyString, + wxDefaultPosition, wxSize(300, -1), 0, + wxTextValidator(wxFILTER_NONE, &m_data.Path1)); + grid->Add(Path1, 1, wxBOTTOM | wxEXPAND, 10); - wxTextCtrl *Path1Rev = new wxTextCtrl (this, -1, wxEmptyString, - wxDefaultPosition, wxDefaultSize, 0, - wxTextValidator (wxFILTER_NUMERIC, &m_data.Path1Rev)); - grid->Add (Path1Rev, 0, wxLEFT, 20); + wxTextCtrl *Path1Rev = new wxTextCtrl(this, -1, wxEmptyString, + wxDefaultPosition, wxDefaultSize, 0, + wxTextValidator(wxFILTER_NUMERIC, &m_data.Path1Rev)); + grid->Add(Path1Rev, 0, wxLEFT, 20); // Row 2: - grid->Add (new wxStaticText (this, -1, _("Second working copy or URL")), - 0, 0, 5); - grid->Add (new wxStaticText (this, -1, _("Revision")), 0, - wxLEFT | wxALIGN_CENTER_VERTICAL, 20); + grid->Add(new wxStaticText(this, -1, _("Second working copy or URL")), + 0, 0, 5); + grid->Add(new wxStaticText(this, -1, _("Revision")), 0, + wxLEFT | wxALIGN_CENTER_VERTICAL, 20); // Row 3: wxTextCtrl * Path2 = - new wxTextCtrl (this, -1, wxEmptyString, - wxDefaultPosition, wxDefaultSize, - 0, wxTextValidator (wxFILTER_NONE, &m_data.Path2)); - grid->Add (Path2, 1, wxBOTTOM | wxEXPAND, 10); + new wxTextCtrl(this, -1, wxEmptyString, + wxDefaultPosition, wxDefaultSize, + 0, wxTextValidator(wxFILTER_NONE, &m_data.Path2)); + grid->Add(Path2, 1, wxBOTTOM | wxEXPAND, 10); wxTextCtrl *Path2Rev = - new wxTextCtrl (this, -1, wxEmptyString, - wxDefaultPosition, wxDefaultSize, 0, - wxTextValidator (wxFILTER_NUMERIC, &m_data.Path2Rev)); - grid->Add (Path2Rev, 0, wxLEFT, 20); + new wxTextCtrl(this, -1, wxEmptyString, + wxDefaultPosition, wxDefaultSize, 0, + wxTextValidator(wxFILTER_NUMERIC, &m_data.Path2Rev)); + grid->Add(Path2Rev, 0, wxLEFT, 20); // Row 4: if (m_data.calledByLogDlg) - grid->Add (new wxStaticText(this, -1, _("Destination file")), 0, 0, 5); + grid->Add(new wxStaticText(this, -1, _("Destination file")), 0, 0, 5); else - grid->Add (new wxStaticText(this, -1, _("Destination path")), 0, 0, 5); - grid->Add (new wxStaticText(this, -1, wxEmptyString), 0, - wxLEFT | wxALIGN_CENTER_VERTICAL, 20); + grid->Add(new wxStaticText(this, -1, _("Destination path")), 0, 0, 5); + grid->Add(new wxStaticText(this, -1, wxEmptyString), 0, + wxLEFT | wxALIGN_CENTER_VERTICAL, 20); // Row 5: wxTextCtrl * Destination = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, - wxTextValidator (wxFILTER_NONE, &m_data.Destination)); - grid->Add (Destination, 1, wxBOTTOM | wxEXPAND, 5); + wxTextValidator(wxFILTER_NONE, &m_data.Destination)); + grid->Add(Destination, 1, wxBOTTOM | wxEXPAND, 5); // If called by the log dialogue, the source path and revision is // already given by the selected entries if (m_data.calledByLogDlg) { - Path1->Disable (); - Path2->Disable (); - Path1Rev->Disable (); - Path2Rev->Disable (); + Path1->Disable(); + Path2->Disable(); + Path1Rev->Disable(); + Path2Rev->Disable(); } wxButton* BrowseButton = new wxButton(this, ID_BUTTON_BROWSE, wxT("..."), wxPoint(-1,-1), wxSize(20, -1)); - grid->Add (BrowseButton, 0, wxALL, 5); + grid->Add(BrowseButton, 0, wxALL, 5); - mergeSizer->Add (grid, 1, wxALL | wxEXPAND, 5); + mergeSizer->Add(grid, 1, wxALL | wxEXPAND, 5); // Sundry items row: - wxBoxSizer *sundrySizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer *sundrySizer = new wxBoxSizer(wxHORIZONTAL); wxCheckBox* Recursive = - new wxCheckBox (this, -1, _("Recursive"), wxDefaultPosition, - wxDefaultSize, 0, wxGenericValidator(&m_data.Recursive)); - sundrySizer->Add (Recursive, 0, wxALL, 5); + new wxCheckBox(this, -1, _("Recursive"), wxDefaultPosition, + wxDefaultSize, 0, wxGenericValidator(&m_data.Recursive)); + sundrySizer->Add(Recursive, 0, wxALL, 5); wxCheckBox* Force = - new wxCheckBox (this, -1, _("Force"), wxDefaultPosition, wxDefaultSize, - 0, wxGenericValidator(&m_data.Force)); - sundrySizer->Add (Force, 0, wxALL, 5); + new wxCheckBox(this, -1, _("Force"), wxDefaultPosition, wxDefaultSize, + 0, wxGenericValidator(&m_data.Force)); + sundrySizer->Add(Force, 0, wxALL, 5); // Button row wxBoxSizer * buttonSizer = new wxBoxSizer(wxHORIZONTAL); - wxButton * ok = new wxButton (this, wxID_OK, _("OK" )); - buttonSizer->Add (ok, 0, wxALL, 10); + wxButton * ok = new wxButton(this, wxID_OK, _("OK")); + buttonSizer->Add(ok, 0, wxALL, 10); - wxButton * cancel = new wxButton (this, wxID_CANCEL, _("Cancel")); - buttonSizer->Add (cancel, 0, wxALL, 10); + wxButton * cancel = new wxButton(this, wxID_CANCEL, _("Cancel")); + buttonSizer->Add(cancel, 0, wxALL, 10); // Add all sizers to main sizer - mainSizer->Add (mergeSizer, 0, wxALL | wxEXPAND, 5); - mainSizer->Add (sundrySizer, 0, wxALL | wxCENTER, 5); - mainSizer->Add (buttonSizer, 0, wxALL | wxCENTER, 5); + mainSizer->Add(mergeSizer, 0, wxALL | wxEXPAND, 5); + mainSizer->Add(sundrySizer, 0, wxALL | wxCENTER, 5); + mainSizer->Add(buttonSizer, 0, wxALL | wxCENTER, 5); - SetAutoLayout (true); - SetSizer (mainSizer); + SetAutoLayout(true); + SetSizer(mainSizer); - mainSizer->SetSizeHints (this); - mainSizer->Fit (this); + mainSizer->SetSizeHints(this); + mainSizer->Fit(this); - ok->SetDefault (); + ok->SetDefault(); } /** * Brings up a directory dialog defaulted to the user's home directory. */ void -MergeDlg::OnBrowse (wxCommandEvent & event) +MergeDlg::OnBrowse(wxCommandEvent & event) { // Transfer data from controls into m_pData: - TransferDataFromWindow (); - wxDirDialog dialog (this, - _("Select a destination folder to merge to"), - wxGetHomeDir()); + TransferDataFromWindow(); + wxDirDialog dialog(this, + _("Select a destination folder to merge to"), + wxGetHomeDir()); - if (dialog.ShowModal () == wxID_OK) + if (dialog.ShowModal() == wxID_OK) { - m_data.Destination = dialog.GetPath (); + m_data.Destination = dialog.GetPath(); // Transfer data from m_pData back into controls: - TransferDataToWindow (); + TransferDataToWindow(); } } diff --git a/src/merge_dlg.hpp b/src/merge_dlg.hpp index d9295c4a..efd5ca56 100644 --- a/src/merge_dlg.hpp +++ b/src/merge_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -33,17 +33,17 @@ class MergeDlg:public wxDialog { public: - MergeDlg (wxWindow *parent, bool calledByLogDlg, MergeData & data); - void OnOK (wxCommandEvent& event); - void OnBrowse (wxCommandEvent & event); + MergeDlg(wxWindow *parent, bool calledByLogDlg, MergeData & data); + void OnOK(wxCommandEvent& event); + void OnBrowse(wxCommandEvent & event); private: - void InitializeData (); - int TestRev (wxString & val); + void InitializeData(); + int TestRev(wxString & val); MergeData & m_data; - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/mkdir_action.cpp b/src/mkdir_action.cpp index 3e3a2a8d..31d9d0cc 100644 --- a/src/mkdir_action.cpp +++ b/src/mkdir_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -33,48 +33,48 @@ #include "mkdir_action.hpp" #include "utils.hpp" -MkdirAction::MkdirAction (wxWindow * parent, const wxString & path) - : Action (parent, _("Mkdir"), UPDATE_TREE), - m_path (path) +MkdirAction::MkdirAction(wxWindow * parent, const wxString & path) + : Action(parent, _("Mkdir"), UPDATE_TREE), + m_path(path) { } bool -MkdirAction::Prepare () +MkdirAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - DestinationDlg dlg (GetParent (), _("Make directory"), - _("Directory:")); + DestinationDlg dlg(GetParent(), _("Make directory"), + _("Directory:")); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - wxString target (dlg.GetDestination ()); - m_target = target.Strip (wxString::both); + wxString target(dlg.GetDestination()); + m_target = target.Strip(wxString::both); return true; } bool -MkdirAction::Perform () +MkdirAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); - svn::Path pathUtf8 (PathUtf8 (m_path)); - svn::Path targetUtf8 (PathUtf8 (m_target)); - pathUtf8.addComponent (targetUtf8.c_str ()); + svn::Path pathUtf8(PathUtf8(m_path)); + svn::Path targetUtf8(PathUtf8(m_target)); + pathUtf8.addComponent(targetUtf8.c_str()); - client.mkdir (pathUtf8); + client.mkdir(pathUtf8); return true; } bool -MkdirAction::CheckStatusSel (const svn::StatusSel & statusSel) +MkdirAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/mkdir_action.hpp b/src/mkdir_action.hpp index b1bbf4ea..a4745591 100644 --- a/src/mkdir_action.hpp +++ b/src/mkdir_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -47,16 +47,16 @@ class MkdirAction:public Action * @param path path in which the directory is to * be created */ - MkdirAction (wxWindow * parent, const wxString & path); + MkdirAction(wxWindow * parent, const wxString & path); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); }; diff --git a/src/move_action.cpp b/src/move_action.cpp index e28c4f45..74e61953 100644 --- a/src/move_action.cpp +++ b/src/move_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,20 +34,20 @@ #include "move_action.hpp" #include "utils.hpp" -MoveAction::MoveAction (wxWindow * parent, int kind) - : Action (parent, wxEmptyString, UPDATE_TREE), - m_kind (kind) +MoveAction::MoveAction(wxWindow * parent, int kind) + : Action(parent, wxEmptyString, UPDATE_TREE), + m_kind(kind) { if (kind == MOVE_MOVE) - SetName (_("Move")); + SetName(_("Move")); else - SetName (_("Copy")); + SetName(_("Copy")); } bool -MoveAction::Prepare () +MoveAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } @@ -59,47 +59,47 @@ MoveAction::Prepare () flags = DestinationDlg::WITH_FORCE; // create description for the dialog - DestinationDlg dlg (GetParent (), GetName (), - _("Select destination:"), flags, - wxEmptyString, - HISTORY_COPYMOVE_DESTINATION); + DestinationDlg dlg(GetParent(), GetName(), + _("Select destination:"), flags, + wxEmptyString, + HISTORY_COPYMOVE_DESTINATION); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) return false; - m_destination = dlg.GetDestination (); - m_force = dlg.GetForce (); + m_destination = dlg.GetDestination(); + m_force = dlg.GetForce(); return true; } bool -MoveAction::Perform () +MoveAction::Perform() { - svn::Client client (GetContext ()); - svn::Path destPath (GetPath().path()); - destPath.addComponent((PathUtf8 (m_destination)).c_str ()); + svn::Client client(GetContext()); + svn::Path destPath(GetPath().path()); + destPath.addComponent((PathUtf8(m_destination)).c_str()); svn::Revision unusedRevision; - std::vector targets (GetTargets ().targets ()); + std::vector targets(GetTargets().targets()); std::vector::iterator it; - for (it = targets.begin (); it != targets.end (); it++) + for (it = targets.begin(); it != targets.end(); it++) { - svn::Path srcPath (*it); + svn::Path srcPath(*it); - if (srcPath == GetPath ()) + if (srcPath == GetPath()) srcPath = "."; if (m_kind == MOVE_MOVE) - client.move (srcPath, unusedRevision, destPath, m_force); + client.move(srcPath, unusedRevision, destPath, m_force); else - client.copy (srcPath, unusedRevision, destPath); + client.copy(srcPath, unusedRevision, destPath); } return true; } bool -MoveAction::CheckStatusSel (const svn::StatusSel & statusSel) +MoveAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/move_action.hpp b/src/move_action.hpp index 0c1e1441..3aaa6a75 100644 --- a/src/move_action.hpp +++ b/src/move_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -55,16 +55,16 @@ class MoveAction:public Action * @param parent parent window * @param type kind of action (MOVE_MOVE, MOVE_COPY) */ - MoveAction (wxWindow * parent, int kind); + MoveAction(wxWindow * parent, int kind); - virtual bool - Perform (); + virtual bool + Perform(); + + virtual bool + Prepare(); - virtual bool - Prepare (); - static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: int m_kind; diff --git a/src/preferences.cpp b/src/preferences.cpp index 4250a45b..d2b38fd5 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -32,9 +32,9 @@ // platform dependant constants #ifdef _WIN32 - static const wxChar * DEFAULT_EXPLORER = wxT("explorer.exe"); +static const wxChar * DEFAULT_EXPLORER = wxT("explorer.exe"); #else - static const wxChar * DEFAULT_EXPLORER = wxT(""); +static const wxChar * DEFAULT_EXPLORER = wxT(""); #endif static const wxChar * DEFAULT_EDITOR = wxT(""); static const wxChar * DEFAULT_DIFF_TOOL = wxT(""); @@ -73,75 +73,75 @@ static const wxChar CONF_USE_LAST_COMMIT_MESSAGE[] = static const wxChar CONF_RESET_FLAT_MODE_ON_START[] = wxT("/Preferences/ResetFlatModeOnStart"); -Preferences::Preferences () - : editor (DEFAULT_EDITOR), editorAlways (false), editorArgs (wxEmptyString), - explorer (DEFAULT_EXPLORER), explorerAlways (false), - explorerArgs (wxEmptyString), diffTool (DEFAULT_DIFF_TOOL), - diffToolArgs (wxEmptyString), mergeTool (wxEmptyString), - mergeToolArgs(wxEmptyString), purgeTempFiles (true), - authPerBookmark (false), useAuthCache (true) +Preferences::Preferences() + : editor(DEFAULT_EDITOR), editorAlways(false), editorArgs(wxEmptyString), + explorer(DEFAULT_EXPLORER), explorerAlways(false), + explorerArgs(wxEmptyString), diffTool(DEFAULT_DIFF_TOOL), + diffToolArgs(wxEmptyString), mergeTool(wxEmptyString), + mergeToolArgs(wxEmptyString), purgeTempFiles(true), + authPerBookmark(false), useAuthCache(true) { - Read (); + Read(); } -Preferences::~Preferences () +Preferences::~Preferences() { - Write (); + Write(); } void -Preferences::Read () +Preferences::Read() { - wxConfigBase * config = wxConfigBase::Get (); + wxConfigBase * config = wxConfigBase::Get(); // If these reads fail, the default values from the constructor remain - editor = config->Read (CONF_EDITOR, editor); - config->Read (CONF_EDITOR_ALWAYS, &editorAlways); - editorArgs = config->Read (CONF_EDITOR_ARGS, editorArgs); + editor = config->Read(CONF_EDITOR, editor); + config->Read(CONF_EDITOR_ALWAYS, &editorAlways); + editorArgs = config->Read(CONF_EDITOR_ARGS, editorArgs); - explorer = config->Read (CONF_EXPLORER, explorer); - config->Read (CONF_EXPLORER_ALWAYS, &explorerAlways); - explorerArgs = config->Read (CONF_EXPLORER_ARGS, explorerArgs); + explorer = config->Read(CONF_EXPLORER, explorer); + config->Read(CONF_EXPLORER_ALWAYS, &explorerAlways); + explorerArgs = config->Read(CONF_EXPLORER_ARGS, explorerArgs); - diffTool = config->Read (CONF_DIFF_TOOL, diffTool); - diffToolArgs = config->Read (CONF_DIFF_TOOL_ARGS, diffToolArgs); + diffTool = config->Read(CONF_DIFF_TOOL, diffTool); + diffToolArgs = config->Read(CONF_DIFF_TOOL_ARGS, diffToolArgs); mergeTool = config->Read(CONF_MERGE_TOOL, mergeTool); mergeToolArgs = config->Read(CONF_MERGE_TOOL_ARGS, mergeToolArgs); - config->Read (CONF_PURGE_TEMP_FILES, &purgeTempFiles); - config->Read (CONF_AUTH_PER_BOOKMARK, &authPerBookmark); - config->Read (CONF_USE_AUTH_CACHE, &useAuthCache); - - config->Read (CONF_USE_LAST_COMMIT_MESSAGE, &useLastCommitMessage); - config->Read (CONF_RESET_FLAT_MODE_ON_START, &resetFlatModeOnStart, false); + config->Read(CONF_PURGE_TEMP_FILES, &purgeTempFiles); + config->Read(CONF_AUTH_PER_BOOKMARK, &authPerBookmark); + config->Read(CONF_USE_AUTH_CACHE, &useAuthCache); + + config->Read(CONF_USE_LAST_COMMIT_MESSAGE, &useLastCommitMessage); + config->Read(CONF_RESET_FLAT_MODE_ON_START, &resetFlatModeOnStart, false); } -void Preferences::Write () const +void Preferences::Write() const { - wxConfigBase * config = wxConfigBase::Get (); + wxConfigBase * config = wxConfigBase::Get(); - config->Write (CONF_EDITOR, editor); - config->Write (CONF_EDITOR_ALWAYS, editorAlways); - config->Write (CONF_EDITOR_ARGS, editorArgs); + config->Write(CONF_EDITOR, editor); + config->Write(CONF_EDITOR_ALWAYS, editorAlways); + config->Write(CONF_EDITOR_ARGS, editorArgs); - config->Write (CONF_EXPLORER, explorer); - config->Write (CONF_EXPLORER_ALWAYS, explorerAlways); - config->Write (CONF_EXPLORER_ARGS, explorerArgs); + config->Write(CONF_EXPLORER, explorer); + config->Write(CONF_EXPLORER_ALWAYS, explorerAlways); + config->Write(CONF_EXPLORER_ARGS, explorerArgs); - config->Write (CONF_DIFF_TOOL, diffTool); - config->Write (CONF_DIFF_TOOL_ARGS, diffToolArgs); + config->Write(CONF_DIFF_TOOL, diffTool); + config->Write(CONF_DIFF_TOOL_ARGS, diffToolArgs); - config->Write (CONF_MERGE_TOOL, mergeTool); - config->Write (CONF_MERGE_TOOL_ARGS, mergeToolArgs); + config->Write(CONF_MERGE_TOOL, mergeTool); + config->Write(CONF_MERGE_TOOL_ARGS, mergeToolArgs); - config->Write (CONF_PURGE_TEMP_FILES, purgeTempFiles); + config->Write(CONF_PURGE_TEMP_FILES, purgeTempFiles); - config->Write (CONF_AUTH_PER_BOOKMARK, authPerBookmark); - config->Write (CONF_USE_AUTH_CACHE, useAuthCache); + config->Write(CONF_AUTH_PER_BOOKMARK, authPerBookmark); + config->Write(CONF_USE_AUTH_CACHE, useAuthCache); - config->Write (CONF_USE_LAST_COMMIT_MESSAGE, useLastCommitMessage); - config->Write (CONF_RESET_FLAT_MODE_ON_START, resetFlatModeOnStart); + config->Write(CONF_USE_LAST_COMMIT_MESSAGE, useLastCommitMessage); + config->Write(CONF_RESET_FLAT_MODE_ON_START, resetFlatModeOnStart); } /* ----------------------------------------------------------------- diff --git a/src/preferences.hpp b/src/preferences.hpp index 094b28fd..62226fb7 100644 --- a/src/preferences.hpp +++ b/src/preferences.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,12 +36,12 @@ struct Preferences /** * default constructor */ - Preferences (); + Preferences(); /** * destructor */ - virtual ~Preferences (); + virtual ~Preferences(); /** * location of the executable to edit files @@ -115,14 +115,14 @@ struct Preferences */ bool useLastCommitMessage; - /** - * always save state of flat mode as reset/false - */ + /** + * always save state of flat mode as reset/false + */ bool resetFlatModeOnStart; private: - void Read (); - void Write () const; + void Read(); + void Write() const; }; #endif // _PREFERENCES_H_INCLUDED_ diff --git a/src/preferences_dlg.cpp b/src/preferences_dlg.cpp index 46ca5d52..4d246318 100644 --- a/src/preferences_dlg.cpp +++ b/src/preferences_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -44,15 +44,15 @@ static const wxChar * EXECUTABLE_WILDCARD = _("All files|*"); #endif -PreferencesDlg::PreferencesDlg (wxWindow* parent, Preferences * prefs) - : PreferencesDlgBase (parent, -1, _("Preferences"), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), m_prefs (prefs) +PreferencesDlg::PreferencesDlg(wxWindow* parent, Preferences * prefs) + : PreferencesDlgBase(parent, -1, _("Preferences"), + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), m_prefs(prefs) { - CentreOnParent (); + CentreOnParent(); } -PreferencesDlg::~PreferencesDlg () +PreferencesDlg::~PreferencesDlg() { } @@ -60,31 +60,31 @@ PreferencesDlg::~PreferencesDlg () * @return true if transfer succeeded. */ bool -PreferencesDlg::TransferDataFromWindow () +PreferencesDlg::TransferDataFromWindow() { // General - m_prefs->purgeTempFiles = m_checkPurgeTempFiles->GetValue (); - m_prefs->useLastCommitMessage = m_checkUseLastCommitMessage->GetValue (); - m_prefs->resetFlatModeOnStart = m_checkResetFlatMode->GetValue (); + m_prefs->purgeTempFiles = m_checkPurgeTempFiles->GetValue(); + m_prefs->useLastCommitMessage = m_checkUseLastCommitMessage->GetValue(); + m_prefs->resetFlatModeOnStart = m_checkResetFlatMode->GetValue(); // Programs - m_prefs->editor = m_textEditor->GetValue (); - m_prefs->editorArgs = m_textEditorArgs->GetValue (); - m_prefs->editorAlways = m_checkEditorAlways->GetValue (); + m_prefs->editor = m_textEditor->GetValue(); + m_prefs->editorArgs = m_textEditorArgs->GetValue(); + m_prefs->editorAlways = m_checkEditorAlways->GetValue(); - m_prefs->explorer = m_textExplorer->GetValue (); - m_prefs->explorerArgs = m_textExplorerArgs->GetValue (); - m_prefs->explorerAlways = m_checkExplorerAlways->GetValue (); + m_prefs->explorer = m_textExplorer->GetValue(); + m_prefs->explorerArgs = m_textExplorerArgs->GetValue(); + m_prefs->explorerAlways = m_checkExplorerAlways->GetValue(); - m_prefs->diffTool = m_textDiffTool->GetValue (); - m_prefs->diffToolArgs = m_textDiffToolArgs->GetValue (); + m_prefs->diffTool = m_textDiffTool->GetValue(); + m_prefs->diffToolArgs = m_textDiffToolArgs->GetValue(); - m_prefs->mergeTool = m_textMergeTool->GetValue (); - m_prefs->mergeToolArgs = m_textMergeToolArgs->GetValue (); + m_prefs->mergeTool = m_textMergeTool->GetValue(); + m_prefs->mergeToolArgs = m_textMergeToolArgs->GetValue(); // Authentication - m_prefs->authPerBookmark = m_checkAuthPerBookmark->GetValue (); - m_prefs->useAuthCache = m_checkUseAuthCache->GetValue (); + m_prefs->authPerBookmark = m_checkAuthPerBookmark->GetValue(); + m_prefs->useAuthCache = m_checkUseAuthCache->GetValue(); return true; } @@ -93,78 +93,78 @@ PreferencesDlg::TransferDataFromWindow () * @return true if transfer succeeded. */ bool -PreferencesDlg::TransferDataToWindow () +PreferencesDlg::TransferDataToWindow() { // General - m_checkPurgeTempFiles->SetValue (m_prefs->purgeTempFiles); - m_checkUseLastCommitMessage->SetValue (m_prefs->useLastCommitMessage); - m_checkResetFlatMode->SetValue (m_prefs->resetFlatModeOnStart); + m_checkPurgeTempFiles->SetValue(m_prefs->purgeTempFiles); + m_checkUseLastCommitMessage->SetValue(m_prefs->useLastCommitMessage); + m_checkResetFlatMode->SetValue(m_prefs->resetFlatModeOnStart); // Programs - m_textEditor->SetValue (m_prefs->editor); - m_textEditorArgs->SetValue (m_prefs->editorArgs); - m_checkEditorAlways->SetValue (m_prefs->editorAlways); + m_textEditor->SetValue(m_prefs->editor); + m_textEditorArgs->SetValue(m_prefs->editorArgs); + m_checkEditorAlways->SetValue(m_prefs->editorAlways); - m_textExplorer->SetValue (m_prefs->explorer); - m_textExplorerArgs->SetValue (m_prefs->explorerArgs); - m_checkExplorerAlways->SetValue (m_prefs->explorerAlways); + m_textExplorer->SetValue(m_prefs->explorer); + m_textExplorerArgs->SetValue(m_prefs->explorerArgs); + m_checkExplorerAlways->SetValue(m_prefs->explorerAlways); - m_textDiffTool->SetValue (m_prefs->diffTool); - m_textDiffToolArgs->SetValue (m_prefs->diffToolArgs); + m_textDiffTool->SetValue(m_prefs->diffTool); + m_textDiffToolArgs->SetValue(m_prefs->diffToolArgs); - m_textMergeTool->SetValue (m_prefs->mergeTool); - m_textMergeToolArgs->SetValue (m_prefs->mergeToolArgs); + m_textMergeTool->SetValue(m_prefs->mergeTool); + m_textMergeToolArgs->SetValue(m_prefs->mergeToolArgs); // Authentication - m_checkAuthPerBookmark->SetValue (m_prefs->authPerBookmark); - m_checkUseAuthCache->SetValue (m_prefs->useAuthCache); + m_checkAuthPerBookmark->SetValue(m_prefs->authPerBookmark); + m_checkUseAuthCache->SetValue(m_prefs->useAuthCache); return true; } -bool -PreferencesDlg::SelectExecutable (const wxString & title, wxTextCtrl * textCtrl) +bool +PreferencesDlg::SelectExecutable(const wxString & title, wxTextCtrl * textCtrl) { - wxFileDialog dlg (this, title, wxEmptyString, wxEmptyString, - EXECUTABLE_WILDCARD, wxOPEN); - dlg.SetPath (textCtrl->GetValue ()); + wxFileDialog dlg(this, title, wxEmptyString, wxEmptyString, + EXECUTABLE_WILDCARD, wxOPEN); + dlg.SetPath(textCtrl->GetValue()); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) return false; - textCtrl->SetValue (dlg.GetPath ()); - return true; + textCtrl->SetValue(dlg.GetPath()); + return true; } -void -PreferencesDlg::OnButtonEditorClick (wxCommandEvent& event) +void +PreferencesDlg::OnButtonEditorClick(wxCommandEvent& event) { - SelectExecutable ( + SelectExecutable( _("Select standard editor executable"), m_textEditor); } void -PreferencesDlg::OnButtonExplorerClick (wxCommandEvent& event) +PreferencesDlg::OnButtonExplorerClick(wxCommandEvent& event) { - SelectExecutable ( + SelectExecutable( _("Select standard file explorer executable"), m_textExplorer); } void -PreferencesDlg::OnButtonDiffToolClick (wxCommandEvent& event) +PreferencesDlg::OnButtonDiffToolClick(wxCommandEvent& event) { - SelectExecutable ( + SelectExecutable( _("Select diff tool executable"), m_textDiffTool); } void -PreferencesDlg::OnButtonMergeToolClick (wxCommandEvent& event) +PreferencesDlg::OnButtonMergeToolClick(wxCommandEvent& event) { - SelectExecutable ( + SelectExecutable( _("Select merge tool executable"), m_textMergeTool); } diff --git a/src/preferences_dlg.hpp b/src/preferences_dlg.hpp index 3d1fd809..edbe9c75 100644 --- a/src/preferences_dlg.hpp +++ b/src/preferences_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,12 +39,12 @@ class PreferencesDlg : public PreferencesDlgBase /** * constructor */ - PreferencesDlg (wxWindow* parent, Preferences * prefs); + PreferencesDlg(wxWindow* parent, Preferences * prefs); /** * destructor */ - virtual ~PreferencesDlg (); + virtual ~PreferencesDlg(); /** * A specialised version of TransferDataFromWindow that calls @@ -52,7 +52,7 @@ class PreferencesDlg : public PreferencesDlgBase * is not the default base class behaviour. * @return true if transfer succeeded. */ - virtual bool TransferDataFromWindow (); + virtual bool TransferDataFromWindow(); /** * A specialised version of TransferDataToWindow that calls @@ -60,24 +60,24 @@ class PreferencesDlg : public PreferencesDlgBase * is not the default base class behaviour. * @return true if transfer succeeded. */ - virtual bool TransferDataToWindow (); + virtual bool TransferDataToWindow(); protected: - virtual void OnButtonEditorClick (wxCommandEvent& event); - virtual void OnButtonExplorerClick (wxCommandEvent& event); - virtual void OnButtonDiffToolClick (wxCommandEvent& event); - virtual void OnButtonMergeToolClick (wxCommandEvent& event); + virtual void OnButtonEditorClick(wxCommandEvent& event); + virtual void OnButtonExplorerClick(wxCommandEvent& event); + virtual void OnButtonDiffToolClick(wxCommandEvent& event); + virtual void OnButtonMergeToolClick(wxCommandEvent& event); private: /** * disallow default constructor */ - PreferencesDlg (); + PreferencesDlg(); /** * disallow copy constructor */ - PreferencesDlg (const PreferencesDlg &); + PreferencesDlg(const PreferencesDlg &); /** * disallow assignment operator @@ -87,7 +87,7 @@ class PreferencesDlg : public PreferencesDlgBase Preferences * m_prefs; - bool SelectExecutable (const wxString & title, wxTextCtrl * textCtrl); + bool SelectExecutable(const wxString & title, wxTextCtrl * textCtrl); }; #endif // _PREFERENCES_DLG_H_INCLUDED_ diff --git a/src/property_action.cpp b/src/property_action.cpp index b30af617..eb42ba5a 100644 --- a/src/property_action.cpp +++ b/src/property_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -33,32 +33,32 @@ /** * right now this supports only one target */ -PropertyAction::PropertyAction (wxWindow * parent) - : Action (parent, _("Property")) +PropertyAction::PropertyAction(wxWindow * parent) + : Action(parent, _("Property")) { } bool -PropertyAction::Prepare () +PropertyAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - PropertyDlg dlg (GetParent (), GetContext (), GetTarget ()); + PropertyDlg dlg(GetParent(), GetContext(), GetTarget()); - return dlg.ShowModal () == wxID_OK; + return dlg.ShowModal() == wxID_OK; } bool -PropertyAction::Perform () +PropertyAction::Perform() { return true; } bool -PropertyAction::CheckStatusSel (const svn::StatusSel & statusSel) +PropertyAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/property_action.hpp b/src/property_action.hpp index b5d904d2..b6ab9687 100644 --- a/src/property_action.hpp +++ b/src/property_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,16 +37,16 @@ namespace svn class PropertyAction : public Action { public: - PropertyAction (wxWindow * parent); + PropertyAction(wxWindow * parent); - virtual bool - Prepare (); + virtual bool + Prepare(); - virtual bool - Perform (); + virtual bool + Perform(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); }; #endif diff --git a/src/property_dlg.cpp b/src/property_dlg.cpp index 86ef8c85..08769c56 100644 --- a/src/property_dlg.cpp +++ b/src/property_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -42,30 +42,30 @@ struct PropertyDlg::Data svn::Property property; public: - Data (wxWindow * wnd, svn::Context * context, const char * target) - : window (wnd), property (context, target) + Data(wxWindow * wnd, svn::Context * context, const char * target) + : window(wnd), property(context, target) { } }; -PropertyDlg::PropertyDlg (wxWindow * parent, - svn::Context * context, - const svn::Path & target) - : ListEditorDlg (parent, _("Property Editor")) +PropertyDlg::PropertyDlg(wxWindow * parent, + svn::Context * context, + const svn::Path & target) + : ListEditorDlg(parent, _("Property Editor")) { - const char * target_ = target.c_str (); + const char * target_ = target.c_str(); // the property list is read-only when working // on a repository const bool readOnly = svn::Url::isValid(target_); - m = new Data (this, context, target_); + m = new Data(this, context, target_); - SetCaption (_("Properties:")); - SetAddTitle (_("New Property")); - SetEditTitle (_("Edit Property")); - SetReadOnly (readOnly); + SetCaption(_("Properties:")); + SetAddTitle(_("New Property")); + SetEditTitle(_("Edit Property")); + SetReadOnly(readOnly); } -PropertyDlg::~PropertyDlg () +PropertyDlg::~PropertyDlg() { delete m; } @@ -78,46 +78,46 @@ PropertyDlg::~PropertyDlg () * @see WriteToGrid */ void -PropertyDlg::ReadFromGrid () +PropertyDlg::ReadFromGrid() { try { const std::vector & entries = - m->property.entries (); - std::vector::const_iterator it = entries.begin (); + m->property.entries(); + std::vector::const_iterator it = entries.begin(); // first check for deleted properties - while (it != entries.end ()) + while (it != entries.end()) { const svn::PropertyEntry & entry = *it; - const char * name = entry.name.c_str (); - bool found = FindEntry (Utf8ToLocal (name)) != -1; + const char * name = entry.name.c_str(); + bool found = FindEntry(Utf8ToLocal(name)) != -1; if (!found) - m->property.remove (name); + m->property.remove(name); it++; } // now set the rest. this will add missing properties as well int index; - const int count = GetEntryCount (); + const int count = GetEntryCount(); - for (index = 0; index < count; index++ ) + for (index = 0; index < count; index++) { wxString name, value; - GetEntryAtIndex (index, name, value); + GetEntryAtIndex(index, name, value); - std::string nameUtf8 (LocalToUtf8 (name)); - std::string valueUtf8 (LocalToUtf8 (value)); + std::string nameUtf8(LocalToUtf8(name)); + std::string valueUtf8(LocalToUtf8(value)); - m->property.set (nameUtf8.c_str (), valueUtf8.c_str ()); + m->property.set(nameUtf8.c_str(), valueUtf8.c_str()); } } catch (...) { - wxMessageBox (_("Error setting the property values"), _("Error")); + wxMessageBox(_("Error setting the property values"), _("Error")); } } @@ -129,20 +129,20 @@ PropertyDlg::ReadFromGrid () * @see ReadFromGrid */ void -PropertyDlg::WriteToGrid () +PropertyDlg::WriteToGrid() { const std::vector & - entries = m->property.entries (); + entries = m->property.entries(); std::vector::const_iterator - it = entries.begin (); + it = entries.begin(); - DeleteAllEntries (); - while (it != entries.end ()) + DeleteAllEntries(); + while (it != entries.end()) { const svn::PropertyEntry & entry = *it; - SetEntry (Utf8ToLocal (entry.name.c_str ()), - Utf8ToLocal (entry.value.c_str ())); + SetEntry(Utf8ToLocal(entry.name.c_str()), + Utf8ToLocal(entry.value.c_str())); it++; } diff --git a/src/property_dlg.hpp b/src/property_dlg.hpp index 855877b2..6ebaea7c 100644 --- a/src/property_dlg.hpp +++ b/src/property_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -38,21 +38,21 @@ class PropertyDlg : public ListEditorDlg { public: - PropertyDlg (wxWindow * parent, svn::Context * context, - const svn::Path & target); + PropertyDlg(wxWindow * parent, svn::Context * context, + const svn::Path & target); /** * destructor */ - virtual ~PropertyDlg (); + virtual ~PropertyDlg(); protected: virtual void - ReadFromGrid (); + ReadFromGrid(); virtual void - WriteToGrid (); + WriteToGrid(); private: struct Data; @@ -61,12 +61,12 @@ class PropertyDlg : public ListEditorDlg /** * disallow default constructor */ - PropertyDlg (); + PropertyDlg(); /** * disallow copy constructor */ - PropertyDlg (const PropertyDlg &); + PropertyDlg(const PropertyDlg &); /** * disallow assignment operator diff --git a/src/proportional_splitter.cpp b/src/proportional_splitter.cpp index 6f63965c..808ff7aa 100644 --- a/src/proportional_splitter.cpp +++ b/src/proportional_splitter.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -25,61 +25,61 @@ //app #include "proportional_splitter.hpp" -BEGIN_EVENT_TABLE (ProportionalSplitterWindow, wxSplitterWindow) - EVT_SIZE (ProportionalSplitterWindow::OnSize) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(ProportionalSplitterWindow, wxSplitterWindow) + EVT_SIZE(ProportionalSplitterWindow::OnSize) +END_EVENT_TABLE() -ProportionalSplitterWindow::ProportionalSplitterWindow ( - float proportion, wxWindow * parent, wxWindowID id, +ProportionalSplitterWindow::ProportionalSplitterWindow( + float proportion, wxWindow * parent, wxWindowID id, const wxPoint & pos, const wxSize & size, long style, const wxString & name) - : wxSplitterWindow (parent, id, pos, size, style, name), - m_proportion (proportion) + : wxSplitterWindow(parent, id, pos, size, style, name), + m_proportion(proportion) { } bool -ProportionalSplitterWindow::SplitVertically (wxWindow * window1, - wxWindow * window2, - int sashPosition) +ProportionalSplitterWindow::SplitVertically(wxWindow * window1, + wxWindow * window2, + int sashPosition) { bool result = - wxSplitterWindow::SplitVertically (window1, window2, sashPosition); - m_old_length_tot = GetLength (GetSize ()); + wxSplitterWindow::SplitVertically(window1, window2, sashPosition); + m_old_length_tot = GetLength(GetSize()); return result; } bool -ProportionalSplitterWindow::SplitHorizontally (wxWindow * window1, - wxWindow * window2, - int sashPosition) +ProportionalSplitterWindow::SplitHorizontally(wxWindow * window1, + wxWindow * window2, + int sashPosition) { bool result = - wxSplitterWindow::SplitHorizontally (window1, window2, sashPosition); - m_old_length_tot = GetLength (GetSize ()); + wxSplitterWindow::SplitHorizontally(window1, window2, sashPosition); + m_old_length_tot = GetLength(GetSize()); return result; } void -ProportionalSplitterWindow::OnSize (wxSizeEvent & event) +ProportionalSplitterWindow::OnSize(wxSizeEvent & event) { // Require both windows present to do adjustments - if (GetWindow1 () && GetWindow2 ()) + if (GetWindow1() && GetWindow2()) { int new_length_tot, dead_space; float new_length[2]; // Get new lengths - new_length_tot = GetLength (event.m_size); - new_length[0] = GetLength (GetWindow1 ()->GetSize ()); - new_length[1] = GetLength (GetWindow2 ()->GetSize ()); - dead_space = GetSashSize () + GetBorderSize () * 2; + new_length_tot = GetLength(event.m_size); + new_length[0] = GetLength(GetWindow1()->GetSize()); + new_length[1] = GetLength(GetWindow2()->GetSize()); + dead_space = GetSashSize() + GetBorderSize() * 2; // If there's not enough space for both to be bigger than the minimum pane // size, we have to resort to distributing the remaining space evenly, // skipping the proportions float maximum_potential_size = new_length_tot - dead_space; - if (maximum_potential_size < GetMinimumPaneSize () * 2) + if (maximum_potential_size < GetMinimumPaneSize() * 2) { new_length[0] = maximum_potential_size / 2.0f; new_length[1] = new_length_tot - new_length[0] - dead_space; @@ -97,10 +97,10 @@ ProportionalSplitterWindow::OnSize (wxSizeEvent & event) // We know this is going to work, because we've made certain we've got // enough space for at least two minimum-sized panes for (int i = 0; i < 2; i++) - if (new_length[i] < GetMinimumPaneSize ()) + if (new_length[i] < GetMinimumPaneSize()) { - new_length[1 - i] -= GetMinimumPaneSize () - new_length[i]; - new_length[i] = GetMinimumPaneSize (); + new_length[1 - i] -= GetMinimumPaneSize() - new_length[i]; + new_length[i] = GetMinimumPaneSize(); break; } } @@ -108,15 +108,15 @@ ProportionalSplitterWindow::OnSize (wxSizeEvent & event) m_old_length_tot = new_length_tot; // Make the nescessary adjustments - SetSashPosition ((int)new_length[0] - GetBorderSize ()); + SetSashPosition((int)new_length[0] - GetBorderSize()); } } int -ProportionalSplitterWindow::GetLength (const wxSize & size) const +ProportionalSplitterWindow::GetLength(const wxSize & size) const { - return (GetSplitMode () == - wxSPLIT_HORIZONTAL ? size.GetHeight () : size.GetWidth ()); + return (GetSplitMode() == + wxSPLIT_HORIZONTAL ? size.GetHeight() : size.GetWidth()); } /* ----------------------------------------------------------------- diff --git a/src/proportional_splitter.hpp b/src/proportional_splitter.hpp index 52095974..31f973fb 100644 --- a/src/proportional_splitter.hpp +++ b/src/proportional_splitter.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,10 +35,10 @@ class ProportionalSplitterWindow : public wxSplitterWindow { public: - ProportionalSplitterWindow (float proportion, wxWindow *parent, - wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxSP_3D, - const wxString& name = wxT("splitter")); + ProportionalSplitterWindow(float proportion, wxWindow *parent, + wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, long style = wxSP_3D, + const wxString& name = wxT("splitter")); /** * We need to update the old length when the window is resplit, as @@ -54,7 +54,7 @@ class ProportionalSplitterWindow : public wxSplitterWindow float m_proportion; int m_old_length_tot; - void OnSize (wxSizeEvent & event); + void OnSize(wxSizeEvent & event); /* * Get the relevant length component from the given size diff --git a/src/rapidsvn_app.cpp b/src/rapidsvn_app.cpp index a8dab3e6..10edb175 100644 --- a/src/rapidsvn_app.cpp +++ b/src/rapidsvn_app.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -50,70 +50,70 @@ static const wxChar TIPS_SHOW_AT_STARTUP[] = wxT("/Main/TipsShowAtStartup"); static const wxChar TIPS_LAST_INDEX[] = wxT("/Main/TipsLastIndex"); #endif -IMPLEMENT_APP (RapidSvnApp) +IMPLEMENT_APP(RapidSvnApp) -bool RapidSvnApp::OnInit () +bool RapidSvnApp::OnInit() { // application and vendor name are used by wxConfig to construct the name // of the config file/registry key and must be set before the first call // to Get() if you want to override the default values (the application // name is the name of the executable and the vendor name is the same) - SetVendorName (APPLICATION_NAME); - SetAppName (APPLICATION_NAME); + SetVendorName(APPLICATION_NAME); + SetAppName(APPLICATION_NAME); - m_locale.Init (); - m_locale.AddCatalogLookupPathPrefix (wxT("locale")); + m_locale.Init(); + m_locale.AddCatalogLookupPathPrefix(wxT("locale")); #ifdef __WXMAC__ - m_locale.AddCatalogLookupPathPrefix ( - wxStandardPaths::Get ().GetResourcesDir () + - wxFileName::GetPathSeparator () + + m_locale.AddCatalogLookupPathPrefix( + wxStandardPaths::Get().GetResourcesDir() + + wxFileName::GetPathSeparator() + wxT("locale")); #endif //__WXMAC__ - m_locale.AddCatalog (wxT("rapidsvn")); + m_locale.AddCatalog(wxT("rapidsvn")); // Add support for PNG wxImage::AddHandler(new wxPNGHandler); // Add support for SVN_ASP_DOT_NET_HACK - if (wxGetEnv (wxT("SVN_ASP_DOT_NET_HACK"), 0)) - svn::Wc::setAdmDir ("_svn"); + if (wxGetEnv(wxT("SVN_ASP_DOT_NET_HACK"), 0)) + svn::Wc::setAdmDir("_svn"); #ifdef _WIN32 // Avoiding to conflict with different versioned apr-iconv. wxString apr_iconv_path; - if (wxGetEnv (wxT("APR_ICONV_PATH"), &apr_iconv_path)) + if (wxGetEnv(wxT("APR_ICONV_PATH"), &apr_iconv_path)) { - wxSetEnv (wxT("__SAVED_APR_ICONV_PATH"), apr_iconv_path.c_str ()); - wxSetEnv (wxT("APR_ICONV_PATH"), wxStandardPaths::Get ().GetDataDir () + wxT("\\iconv")); + wxSetEnv(wxT("__SAVED_APR_ICONV_PATH"), apr_iconv_path.c_str()); + wxSetEnv(wxT("APR_ICONV_PATH"), wxStandardPaths::Get().GetDataDir() + wxT("\\iconv")); } #endif #ifdef USE_HTML_HELP // Initialise the HTML help - wxFileSystem::AddHandler (new wxZipFSHandler); + wxFileSystem::AddHandler(new wxZipFSHandler); m_helpController = new wxHtmlHelpController; m_helpController->SetTitleFormat(_("RapidSVN Help: %s")); - LocateHelp (); + LocateHelp(); // Initialise a popup-help-text provider system, connected to the main help system wxHelpControllerHelpProvider* provider = new wxHelpControllerHelpProvider; - provider->SetHelpController (m_helpController); + provider->SetHelpController(m_helpController); #else wxSimpleHelpProvider* provider = new wxSimpleHelpProvider; #endif - wxHelpProvider::Set (provider); + wxHelpProvider::Set(provider); - RapidSvnFrame * frame = new RapidSvnFrame (APPLICATION_NAME, m_locale); - frame->Show (TRUE); - SetTopWindow (frame); + RapidSvnFrame * frame = new RapidSvnFrame(APPLICATION_NAME, m_locale); + frame->Show(TRUE); + SetTopWindow(frame); // Show tips if configured #ifdef USE_STARTUP_TIPS - wxTipProvider* tipProvider = MakeTipProvider (); + wxTipProvider* tipProvider = MakeTipProvider(); if (tipProvider) { - bool showAtStartup = wxShowTip (frame, tipProvider); - SaveTipsInfo (showAtStartup, tipProvider->GetCurrentTip ()); + bool showAtStartup = wxShowTip(frame, tipProvider); + SaveTipsInfo(showAtStartup, tipProvider->GetCurrentTip()); delete tipProvider; } #endif @@ -122,14 +122,14 @@ bool RapidSvnApp::OnInit () } int -RapidSvnApp::OnExit () +RapidSvnApp::OnExit() { - OptionallyPurgeTempFiles (); + OptionallyPurgeTempFiles(); - TheHistoryManager.Cleanup (); + TheHistoryManager.Cleanup(); // destroy application configuration object - delete wxConfigBase::Set ((wxConfigBase *) NULL); + delete wxConfigBase::Set((wxConfigBase *) NULL); // Remove the help provider & close down help delete wxHelpProvider::Set(NULL); @@ -141,7 +141,7 @@ RapidSvnApp::OnExit () } void -RapidSvnApp::OptionallyRegisterTempFile (const wxString & filename) +RapidSvnApp::OptionallyRegisterTempFile(const wxString & filename) { Preferences prefs; @@ -151,80 +151,80 @@ RapidSvnApp::OptionallyRegisterTempFile (const wxString & filename) } else { - m_TempFiles.Clear (); + m_TempFiles.Clear(); } } void -RapidSvnApp::OptionallyPurgeTempFiles () +RapidSvnApp::OptionallyPurgeTempFiles() { Preferences prefs; if (prefs.purgeTempFiles) { - for (size_t i = 0; i < m_TempFiles.GetCount (); ++i) + for (size_t i = 0; i < m_TempFiles.GetCount(); ++i) { - ::wxRemoveFile (m_TempFiles.Item (i)); + ::wxRemoveFile(m_TempFiles.Item(i)); } } - m_TempFiles.Clear (); + m_TempFiles.Clear(); } #ifdef USE_HTML_HELP bool -RapidSvnApp::LocateHelp () +RapidSvnApp::LocateHelp() { - wxString appPath = wxFileName(argv[0]).GetPath (wxPATH_GET_VOLUME); - if (appPath.IsEmpty()) - appPath = wxGetCwd(); - wxString appName = wxFileName(argv[0]).GetName(); + wxString appPath = wxFileName(argv[0]).GetPath(wxPATH_GET_VOLUME); + if (appPath.IsEmpty()) + appPath = wxGetCwd(); + wxString appName = wxFileName(argv[0]).GetName(); #ifdef __WXMAC__ - appPath += appName + wxT(".app/Contents/Resources")); + appPath += appName + wxT(".app/Contents/Resources")); #endif - wxString helpfile = appPath + wxFileName::GetPathSeparator() + appName + wxT(".htb"); - wxConfigBase* cfg = wxConfigBase::Get (); - helpfile = cfg->Read (HELP_FILE, helpfile); - if (helpfile.IsEmpty ()) + wxString helpfile = appPath + wxFileName::GetPathSeparator() + appName + wxT(".htb"); + wxConfigBase* cfg = wxConfigBase::Get(); + helpfile = cfg->Read(HELP_FILE, helpfile); + if (helpfile.IsEmpty()) + { + return false; + } + + // TODO: Hmmm - I haven't called Initialise yet, but AddBook seems to work directly... + while (!m_helpController->AddBook(wxFileName(helpfile))) + { + wxFileDialog dlg(NULL, _("Locate help"), appPath, wxEmptyString, wxT("*.htb"), wxOPEN | wxFILE_MUST_EXIST); + if (dlg.ShowModal() == wxID_OK) { - return false; + helpfile = dlg.GetPath(); + cfg->Write(HELP_FILE, helpfile); } - - // TODO: Hmmm - I haven't called Initialise yet, but AddBook seems to work directly... - while (!m_helpController->AddBook (wxFileName(helpfile))) + else { - wxFileDialog dlg (NULL, _("Locate help"), appPath, wxEmptyString, wxT("*.htb"), wxOPEN | wxFILE_MUST_EXIST); - if (dlg.ShowModal() == wxID_OK) - { - helpfile = dlg.GetPath (); - cfg->Write (HELP_FILE, helpfile); - } - else + if (wxMessageBox(_("No help file was chosen, would you like to be \n" "asked again after next application start?"), _("Locate help"), wxYES_NO | wxICON_QUESTION) == wxYES) + { + if (cfg->Exists(HELP_FILE)) { - if (wxMessageBox (_("No help file was chosen, would you like to be \n" "asked again after next application start?"), _("Locate help"), wxYES_NO | wxICON_QUESTION) == wxYES) - { - if (cfg->Exists (HELP_FILE)) - { - cfg->DeleteEntry (HELP_FILE); - } - } - else - { - helpfile = wxEmptyString; - cfg->Write (HELP_FILE, helpfile); - } - return false; + cfg->DeleteEntry(HELP_FILE); } + } + else + { + helpfile = wxEmptyString; + cfg->Write(HELP_FILE, helpfile); + } + return false; } - return true; + } + return true; } #endif #ifdef USE_STARTUP_TIPS wxTipProvider* -RapidSvnApp::MakeTipProvider (bool force) +RapidSvnApp::MakeTipProvider(bool force) { - wxString appPath = wxFileName(argv[0]).GetPath (wxPATH_GET_VOLUME); + wxString appPath = wxFileName(argv[0]).GetPath(wxPATH_GET_VOLUME); if (appPath.IsEmpty()) { appPath = wxGetCwd(); @@ -235,57 +235,57 @@ RapidSvnApp::MakeTipProvider (bool force) #endif wxString tipsfile = appPath + wxFileName::GetPathSeparator() + appName + wxT("_tips.txt"); - bool showTips = true; - wxConfigBase* cfg = wxConfigBase::Get (); - cfg->Read (TIPS_FILE, &tipsfile); - if (!force) - { - cfg->Read (TIPS_SHOW_AT_STARTUP, &showTips) ; - if (tipsfile.IsEmpty () || !showTips) + bool showTips = true; + wxConfigBase* cfg = wxConfigBase::Get(); + cfg->Read(TIPS_FILE, &tipsfile); + if (!force) +{ + cfg->Read(TIPS_SHOW_AT_STARTUP, &showTips) ; + if (tipsfile.IsEmpty() || !showTips) { return NULL; } } int tipIndex = 0; - cfg->Read (TIPS_LAST_INDEX, &tipIndex); - wxTipProvider* tipProvider = NULL; + cfg->Read(TIPS_LAST_INDEX, &tipIndex); + wxTipProvider* tipProvider = NULL; - while (!wxFileName(tipsfile).FileExists () || (tipProvider = wxCreateFileTipProvider (tipsfile, tipIndex)) == NULL) + while (!wxFileName(tipsfile).FileExists() || (tipProvider = wxCreateFileTipProvider(tipsfile, tipIndex)) == NULL) { - wxFileDialog dlg (NULL, _("Locate tips file"), appPath, wxEmptyString, wxT("*.txt"), wxOPEN | wxFILE_MUST_EXIST); + wxFileDialog dlg(NULL, _("Locate tips file"), appPath, wxEmptyString, wxT("*.txt"), wxOPEN | wxFILE_MUST_EXIST); if (dlg.ShowModal() == wxID_OK) { - tipsfile = dlg.GetPath (); - cfg->Write (TIPS_FILE, tipsfile); + tipsfile = dlg.GetPath(); + cfg->Write(TIPS_FILE, tipsfile); } else { - if (wxMessageBox (_("No tips file was chosen, would you like to be \n" "asked again after next application start?"), _("Locate tips"), wxYES_NO | wxICON_QUESTION) == wxYES) + if (wxMessageBox(_("No tips file was chosen, would you like to be \n" "asked again after next application start?"), _("Locate tips"), wxYES_NO | wxICON_QUESTION) == wxYES) { - if (cfg->Exists (TIPS_FILE)) + if (cfg->Exists(TIPS_FILE)) { - cfg->DeleteEntry (TIPS_FILE); + cfg->DeleteEntry(TIPS_FILE); } } else { tipsfile = wxEmptyString; - cfg->Write (TIPS_FILE, tipsfile); + cfg->Write(TIPS_FILE, tipsfile); } return NULL; } } return tipProvider; -} + } -void -RapidSvnApp::SaveTipsInfo (bool showAtStartup, int tipIndex) + void + RapidSvnApp::SaveTipsInfo(bool showAtStartup, int tipIndex) { - wxConfigBase* cfg = wxConfigBase::Get (); - cfg->Write (TIPS_SHOW_AT_STARTUP, showAtStartup); - cfg->Write (TIPS_LAST_INDEX, tipIndex); + wxConfigBase* cfg = wxConfigBase::Get(); + cfg->Write(TIPS_SHOW_AT_STARTUP, showAtStartup); + cfg->Write(TIPS_LAST_INDEX, tipIndex); } #endif diff --git a/src/rapidsvn_app.hpp b/src/rapidsvn_app.hpp index 3ea40a7b..1aca4162 100644 --- a/src/rapidsvn_app.hpp +++ b/src/rapidsvn_app.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,8 +34,8 @@ class wxTipProvider; class RapidSvnApp:public wxApp { public: - void OptionallyRegisterTempFile (const wxString & filename); - void OptionallyPurgeTempFiles (); + void OptionallyRegisterTempFile(const wxString & filename); + void OptionallyPurgeTempFiles(); #if wxUSE_WXHTML_HELP wxHtmlHelpController& GetHelpController() @@ -46,15 +46,15 @@ class RapidSvnApp:public wxApp #if wxUSE_STARTUP_TIPS wxTipProvider* - MakeTipProvider (bool force = false); + MakeTipProvider(bool force = false); void - SaveTipsInfo (bool showAtStartup, int tipIndex); + SaveTipsInfo(bool showAtStartup, int tipIndex); #endif protected: - virtual bool OnInit (); - virtual int OnExit (); + virtual bool OnInit(); + virtual int OnExit(); private: wxLocale m_locale; @@ -65,11 +65,11 @@ class RapidSvnApp:public wxApp wxHtmlHelpController* m_helpController; bool - LocateHelp (); + LocateHelp(); #endif }; -DECLARE_APP (RapidSvnApp) +DECLARE_APP(RapidSvnApp) #endif /* ----------------------------------------------------------------- diff --git a/src/rapidsvn_drop_target.cpp b/src/rapidsvn_drop_target.cpp index 9a4c9885..28191cdd 100644 --- a/src/rapidsvn_drop_target.cpp +++ b/src/rapidsvn_drop_target.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,25 +34,25 @@ #include "action_event.hpp" bool -RapidSvnDropTarget::OnDropFiles (wxCoord x, wxCoord y, - const wxArrayString & filenames) +RapidSvnDropTarget::OnDropFiles(wxCoord x, wxCoord y, + const wxArrayString & filenames) { - m_destination = GetDestinationPath (wxPoint (x, y)); + m_destination = GetDestinationPath(wxPoint(x, y)); - if (!m_destination.IsEmpty ()) + if (!m_destination.IsEmpty()) { if (filenames.GetCount() > 0) { DragAndDropData* data = new DragAndDropData(); data->m_files = filenames; data->m_destination = m_destination; - ActionEvent::Post (wxGetApp ().GetTopWindow (), - TOKEN_DRAG_N_DROP, data); + ActionEvent::Post(wxGetApp().GetTopWindow(), + TOKEN_DRAG_N_DROP, data); } } else { - wxMessageBox (_("Unknown destination path")); + wxMessageBox(_("Unknown destination path")); return false; } diff --git a/src/rapidsvn_drop_target.hpp b/src/rapidsvn_drop_target.hpp index 555cc36b..14bde516 100644 --- a/src/rapidsvn_drop_target.hpp +++ b/src/rapidsvn_drop_target.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -31,14 +31,16 @@ class RapidSvnDropTarget : public wxFileDropTarget { public: - virtual bool - OnDropFiles (wxCoord x, wxCoord y, const wxArrayString& filenames); + virtual bool + OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames); - virtual wxString - GetDestinationPath () { return m_destination; } + virtual wxString + GetDestinationPath() { + return m_destination; + } - virtual wxString - GetDestinationPath (const wxPoint & point) = 0; + virtual wxString + GetDestinationPath(const wxPoint & point) = 0; private: wxString m_destination; diff --git a/src/rapidsvn_frame.cpp b/src/rapidsvn_frame.cpp index 5b8655f4..a5564e84 100644 --- a/src/rapidsvn_frame.cpp +++ b/src/rapidsvn_frame.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -141,12 +141,12 @@ const static int SPLITTER_STYLE = wxSP_3D | wxSP_LIVE_UPDATE | wxCLIP_CHILDREN; * @return new action worker instance */ ActionWorker * -CreateActionWorker (wxWindow * parent) +CreateActionWorker(wxWindow * parent) { #ifdef USE_SIMPLE_WORKER - return new SimpleWorker (parent); + return new SimpleWorker(parent); #else - return new ThreadedWorker (parent); + return new ThreadedWorker(parent); #endif } @@ -195,27 +195,27 @@ struct RapidSvnFrame::Data */ svn::Apr apr; - Data (wxFrame * parent, const wxLocale & locale_) - : folderBrowser (0), listCtrl (0), - horizSplitter (0), vertSplitter (0), - log (0), logTracer (0), - MenuColumns (0), MenuSorting (0), MenuBar (0), - listener (parent), - updateAfterActivate (false), dontUpdateFilelist (false), - skipFilelistUpdate (false), locale (locale_), - currentPath (wxT("")), - activePane (ACTIVEPANE_FOLDER_BROWSER), - showUnversioned (false), showUnmodified (false), - showModified (false), showConflicted (false), - m_running (false), - m_toolbar_rows (1), m_parent (parent), - m_isErrorDialogActive (false) - { - InitializeMenu (); + Data(wxFrame * parent, const wxLocale & locale_) + : folderBrowser(0), listCtrl(0), + horizSplitter(0), vertSplitter(0), + log(0), logTracer(0), + MenuColumns(0), MenuSorting(0), MenuBar(0), + listener(parent), + updateAfterActivate(false), dontUpdateFilelist(false), + skipFilelistUpdate(false), locale(locale_), + currentPath(wxT("")), + activePane(ACTIVEPANE_FOLDER_BROWSER), + showUnversioned(false), showUnmodified(false), + showModified(false), showConflicted(false), + m_running(false), + m_toolbar_rows(1), m_parent(parent), + m_isErrorDialogActive(false) + { + InitializeMenu(); } void - InitializeMenu () + InitializeMenu() { // the following code places the menu items in their correct @@ -231,20 +231,20 @@ struct RapidSvnFrame::Data // Quit menu item is not necessary on MacOSX: #ifndef __WXMAC__ //menuFile->AppendSeparator (); - AppendMenuItem (*menuFile, ID_Quit); + AppendMenuItem(*menuFile, ID_Quit); #endif // Columns menu MenuColumns = new wxMenu; - AppendMenuItem (*MenuColumns, ID_Column_Reset); - MenuColumns->AppendSeparator (); + AppendMenuItem(*MenuColumns, ID_Column_Reset); + MenuColumns->AppendSeparator(); // Sorting menu MenuSorting = new wxMenu; - MenuSorting->AppendCheckItem (ID_Include_Path, _("Use Path for Sorting")); - MenuSorting->AppendCheckItem (ID_Sort_Ascending, _("Sort Ascending")); + MenuSorting->AppendCheckItem(ID_Include_Path, _("Use Path for Sorting")); + MenuSorting->AppendCheckItem(ID_Sort_Ascending, _("Sort Ascending")); - MenuSorting->AppendSeparator (); + MenuSorting->AppendSeparator(); for (int col = 0; col < FileListCtrl::COL_COUNT; col++) { @@ -252,85 +252,85 @@ struct RapidSvnFrame::Data int sortid = id + Columns::SORT_COLUMN_OFFSET; if (id != ID_Column_Name && id != ID_Column_Path) - MenuColumns->AppendCheckItem (id, ColumnList[col].caption); - MenuSorting->AppendRadioItem (sortid, ColumnList[col].caption); + MenuColumns->AppendCheckItem(id, ColumnList[col].caption); + MenuSorting->AppendRadioItem(sortid, ColumnList[col].caption); } // View menu wxMenu *menuView = new wxMenu; - AppendMenuItem (*menuView, ID_Refresh); - AppendMenuItem (*menuView, ID_Stop); - menuView->AppendSeparator (); + AppendMenuItem(*menuView, ID_Refresh); + AppendMenuItem(*menuView, ID_Stop); + menuView->AppendSeparator(); - AppendMenuItem (*menuView, ID_Explore); - menuView->AppendSeparator (); + AppendMenuItem(*menuView, ID_Explore); + menuView->AppendSeparator(); - menuView->Append (0, _("Columns"), MenuColumns); - menuView->Append (0, _("Sort"), MenuSorting); + menuView->Append(0, _("Columns"), MenuColumns); + menuView->Append(0, _("Sort"), MenuSorting); - menuView->AppendCheckItem (ID_Flat, _("Flat Mode")); - menuView->AppendCheckItem (ID_RefreshWithUpdate, _("Refresh with Update")); - menuView->AppendCheckItem (ID_ShowUnversioned, _("Show unversioned entries")); - menuView->AppendCheckItem (ID_ShowUnmodified, _("Show unmodified entries")); - menuView->AppendCheckItem (ID_ShowModified, _("Show modified entries")); - menuView->AppendCheckItem (ID_ShowConflicted, _("Show conflicted entries")); - menuView->AppendCheckItem (ID_IgnoreExternals, _("Ignore Externals")); - menuView->AppendCheckItem (ID_ShowIgnored, _("Show ignored entries")); + menuView->AppendCheckItem(ID_Flat, _("Flat Mode")); + menuView->AppendCheckItem(ID_RefreshWithUpdate, _("Refresh with Update")); + menuView->AppendCheckItem(ID_ShowUnversioned, _("Show unversioned entries")); + menuView->AppendCheckItem(ID_ShowUnmodified, _("Show unmodified entries")); + menuView->AppendCheckItem(ID_ShowModified, _("Show modified entries")); + menuView->AppendCheckItem(ID_ShowConflicted, _("Show conflicted entries")); + menuView->AppendCheckItem(ID_IgnoreExternals, _("Ignore Externals")); + menuView->AppendCheckItem(ID_ShowIgnored, _("Show ignored entries")); // Preferences menu item goes to its own place on MacOSX, // so no separator is necessary. #ifndef __WXMAC__ - menuView->AppendSeparator (); + menuView->AppendSeparator(); #endif - AppendMenuItem (*menuView, ID_Preferences); + AppendMenuItem(*menuView, ID_Preferences); // Repository menu wxMenu *menuRepos = new wxMenu; - menuRepos->Append (ID_Import, _("&Import...\tCTRL-I")); - menuRepos->Append (ID_Export, _("&Export...\tCTRL-E")); - menuRepos->Append (ID_Checkout, _("Check&out...\tCTRL-O")); - menuRepos->Append (ID_CreateRepository, _("&Create...")); + menuRepos->Append(ID_Import, _("&Import...\tCTRL-I")); + menuRepos->Append(ID_Export, _("&Export...\tCTRL-E")); + menuRepos->Append(ID_Checkout, _("Check&out...\tCTRL-O")); + menuRepos->Append(ID_CreateRepository, _("&Create...")); - menuRepos->AppendSeparator (); + menuRepos->AppendSeparator(); - menuRepos->Append (ID_Merge, _("Merge...")); - menuRepos->Append (ID_Switch, _("Switch URL...\tCTRL-S")); + menuRepos->Append(ID_Merge, _("Merge...")); + menuRepos->Append(ID_Switch, _("Switch URL...\tCTRL-S")); // Modify menu wxMenu *menuModif = new wxMenu; - AppendModifyMenu (menuModif); + AppendModifyMenu(menuModif); // Query menu wxMenu *menuQuery = new wxMenu; - AppendQueryMenu (menuQuery); + AppendQueryMenu(menuQuery); // Bookmarks menu wxMenu *menuBookmarks = new wxMenu; - AppendBookmarksMenu (menuBookmarks); + AppendBookmarksMenu(menuBookmarks); // Extras menu wxMenu *menuExtras = new wxMenu; - AppendMenuItem (*menuExtras, ID_Cleanup); + AppendMenuItem(*menuExtras, ID_Cleanup); // Help Menu wxMenu *menuHelp = new wxMenu; - menuHelp->Append (ID_HelpContents, _("&Contents\tF1")); - menuHelp->Append (ID_HelpIndex, _("&Index\tShift+F1")); - menuHelp->AppendSeparator (); + menuHelp->Append(ID_HelpContents, _("&Contents\tF1")); + menuHelp->Append(ID_HelpIndex, _("&Index\tShift+F1")); + menuHelp->AppendSeparator(); #ifdef USE_STARTUP_TIPS - menuHelp->Append (ID_HelpStartupTips, _("Show Startup Tips")); - menuHelp->AppendSeparator (); + menuHelp->Append(ID_HelpStartupTips, _("Show Startup Tips")); + menuHelp->AppendSeparator(); #endif - menuHelp->Append (ID_About, _("&About...")); + menuHelp->Append(ID_About, _("&About...")); #ifdef USE_DEBUG_TESTS // Debug Menu wxMenu *menuTests = new wxMenu; - menuTests->Append (ID_TestNewWxString, _("wxString Creation&Tracing Test")); - menuTests->Append (ID_TestListener, _("Listener Test")); - menuTests->Append (ID_TestCheckout, _("Checkout Test")); + menuTests->Append(ID_TestNewWxString, _("wxString Creation&Tracing Test")); + menuTests->Append(ID_TestListener, _("Listener Test")); + menuTests->Append(ID_TestCheckout, _("Checkout Test")); #endif // Create the menu bar and append the menus @@ -338,292 +338,292 @@ struct RapidSvnFrame::Data // Under wxMac the menu might be empty, so // don't show it: if (menuFile->GetMenuItemCount()>0) - MenuBar->Append (menuFile, _("&File")); - MenuBar->Append (menuView, _("&View")); - MenuBar->Append (menuRepos, _("&Repository")); - MenuBar->Append (menuModif, _("&Modify")); - MenuBar->Append (menuQuery, _("&Query")); - MenuBar->Append (menuBookmarks, _("&Bookmarks")); - MenuBar->Append (menuExtras, _("&Extras")); - MenuBar->Append (menuHelp, _("&Help")); + MenuBar->Append(menuFile, _("&File")); + MenuBar->Append(menuView, _("&View")); + MenuBar->Append(menuRepos, _("&Repository")); + MenuBar->Append(menuModif, _("&Modify")); + MenuBar->Append(menuQuery, _("&Query")); + MenuBar->Append(menuBookmarks, _("&Bookmarks")); + MenuBar->Append(menuExtras, _("&Extras")); + MenuBar->Append(menuHelp, _("&Help")); #ifdef USE_DEBUG_TESTS - MenuBar->Append (menuTests, _("&Tests")); + MenuBar->Append(menuTests, _("&Tests")); #endif } bool - IsColumnChecked (int id) + IsColumnChecked(int id) { - return MenuColumns->IsChecked (id); + return MenuColumns->IsChecked(id); } void - CheckColumn (int id, bool check) + CheckColumn(int id, bool check) { - MenuColumns->Check (id, check); + MenuColumns->Check(id, check); } void - CheckSort (int id) + CheckSort(int id) { - MenuSorting->Check (id, true); + MenuSorting->Check(id, true); } void - EnableMenuEntry (int id, bool enable) + EnableMenuEntry(int id, bool enable) { - MenuSorting->Enable (id, enable); + MenuSorting->Enable(id, enable); } bool - IsMenuChecked (int id) + IsMenuChecked(int id) { - return MenuBar->IsChecked (id); + return MenuBar->IsChecked(id); } void - CheckMenu (int id, bool check) + CheckMenu(int id, bool check) { - MenuBar->Check (id, check); + MenuBar->Check(id, check); } void - SetMenuAndTool (int id, bool & toggleValue, bool newValue) + SetMenuAndTool(int id, bool & toggleValue, bool newValue) { toggleValue = newValue; - + // first update the menu entry - MenuBar->Check (id, toggleValue); + MenuBar->Check(id, toggleValue); // next update the tool - wxToolBarBase * toolBar = m_parent->GetToolBar (); + wxToolBarBase * toolBar = m_parent->GetToolBar(); if (toolBar != 0) - toolBar->ToggleTool (id, toggleValue); + toolBar->ToggleTool(id, toggleValue); } bool - ToggleMenuAndTool (int id, bool & toggleValue) + ToggleMenuAndTool(int id, bool & toggleValue) { - SetMenuAndTool (id, toggleValue, !toggleValue); + SetMenuAndTool(id, toggleValue, !toggleValue); return toggleValue; } void - SetRunning (bool running) + SetRunning(bool running) { if (running && ! m_running) - listener.cancel (false); + listener.cancel(false); m_running = running; - wxToolBarBase * toolBar = m_parent->GetToolBar (); + wxToolBarBase * toolBar = m_parent->GetToolBar(); + + wxASSERT(toolBar != 0); - wxASSERT (toolBar != 0); + toolBar->EnableTool(ID_Stop, running); + MenuBar->Enable(ID_Stop, running); - toolBar->EnableTool (ID_Stop, running); - MenuBar->Enable (ID_Stop, running); - - m_parent->SetCursor (running ? *wxHOURGLASS_CURSOR : *wxSTANDARD_CURSOR); + m_parent->SetCursor(running ? *wxHOURGLASS_CURSOR : *wxSTANDARD_CURSOR); if (folderBrowser) { - folderBrowser->SetCursor (running ? *wxHOURGLASS_CURSOR : *wxSTANDARD_CURSOR); - folderBrowser->Enable (!running); + folderBrowser->SetCursor(running ? *wxHOURGLASS_CURSOR : *wxSTANDARD_CURSOR); + folderBrowser->Enable(!running); } if (listCtrl) { - listCtrl->SetCursor (running ? *wxHOURGLASS_CURSOR : *wxSTANDARD_CURSOR); - listCtrl->Enable (!running); + listCtrl->SetCursor(running ? *wxHOURGLASS_CURSOR : *wxSTANDARD_CURSOR); + listCtrl->Enable(!running); } } bool - IsRunning () const + IsRunning() const { return m_running; } void - RecreateToolbar () + RecreateToolbar() { // delete the old toolbar - wxToolBarBase * toolBar = m_parent->GetToolBar (); + wxToolBarBase * toolBar = m_parent->GetToolBar(); delete toolBar; - m_parent->SetToolBar (NULL); + m_parent->SetToolBar(NULL); long style = wxNO_BORDER | wxTB_FLAT | wxTB_DOCKABLE; style |= wxTB_HORIZONTAL; - toolBar = m_parent->CreateToolBar (style, ID_TOOLBAR); - toolBar->SetMargins (4, 4); - - AddActionTools (toolBar); - AddInfoTools (toolBar); - - toolBar->AddCheckTool (ID_ShowUnversioned, - wxEmptyString, - EMBEDDED_BITMAP(nonsvn_file_png), - wxNullBitmap, - _("Show unversioned entries"), - _("Display unversioned files/directories")); - wxEmptyString, - toolBar->AddCheckTool (ID_ShowUnmodified, - wxEmptyString, - EMBEDDED_BITMAP(normal_file_png), - wxNullBitmap, - _("Show unmodified entries"), - _("Display unmodified files/directories")); - toolBar->AddCheckTool (ID_ShowModified, - wxEmptyString, - EMBEDDED_BITMAP(modified_file_png), - wxNullBitmap, - _("Show modified entries"), - _("Display modified files/directories")); - toolBar->AddCheckTool (ID_ShowConflicted, - wxEmptyString, - EMBEDDED_BITMAP(conflicted_file_png), - wxNullBitmap, - _("Show conflicted entries"), - _("Display conflicted files/directories")); - toolBar->AddSeparator (); + toolBar = m_parent->CreateToolBar(style, ID_TOOLBAR); + toolBar->SetMargins(4, 4); + + AddActionTools(toolBar); + AddInfoTools(toolBar); + + toolBar->AddCheckTool(ID_ShowUnversioned, + wxEmptyString, + EMBEDDED_BITMAP(nonsvn_file_png), + wxNullBitmap, + _("Show unversioned entries"), + _("Display unversioned files/directories")); + wxEmptyString, + toolBar->AddCheckTool(ID_ShowUnmodified, + wxEmptyString, + EMBEDDED_BITMAP(normal_file_png), + wxNullBitmap, + _("Show unmodified entries"), + _("Display unmodified files/directories")); + toolBar->AddCheckTool(ID_ShowModified, + wxEmptyString, + EMBEDDED_BITMAP(modified_file_png), + wxNullBitmap, + _("Show modified entries"), + _("Display modified files/directories")); + toolBar->AddCheckTool(ID_ShowConflicted, + wxEmptyString, + EMBEDDED_BITMAP(conflicted_file_png), + wxNullBitmap, + _("Show conflicted entries"), + _("Display conflicted files/directories")); + toolBar->AddSeparator(); // Set toolbar refresh button. - toolBar->AddTool (ID_Refresh, - EMBEDDED_BITMAP(refresh_png), - wxNullBitmap, - FALSE, - -1, - -1, - (wxObject *) NULL, - _("Refresh"), - _("Refresh the file list")); - - toolBar->AddSeparator (); + toolBar->AddTool(ID_Refresh, + EMBEDDED_BITMAP(refresh_png), + wxNullBitmap, + FALSE, + -1, + -1, + (wxObject *) NULL, + _("Refresh"), + _("Refresh the file list")); + + toolBar->AddSeparator(); // STOP button - toolBar->AddTool (ID_Stop, - EMBEDDED_BITMAP(stop_png), - wxNullBitmap, - FALSE, - -1, - -1, - 0, - _("Stop"), - _("Stop the current action")); + toolBar->AddTool(ID_Stop, + EMBEDDED_BITMAP(stop_png), + wxNullBitmap, + FALSE, + -1, + -1, + 0, + _("Stop"), + _("Stop the current action")); // After adding the buttons to the toolbar, // must call Realize() to reflect the changes. - toolBar->Realize (); + toolBar->Realize(); - toolBar->SetRows (m_toolbar_rows); + toolBar->SetRows(m_toolbar_rows); } void - AddActionTools (wxToolBarBase *toolBar) - { - wxASSERT (toolBar); - - toolBar->AddTool (ID_Add, - EMBEDDED_BITMAP(add_png), - wxNullBitmap, - FALSE, - -1, - -1, - (wxObject *) NULL, - _("Add selected"), - _("Put files and directories under revision control")); - - toolBar->AddTool (ID_Delete, - EMBEDDED_BITMAP(delete_png), - wxNullBitmap, - FALSE, - -1, - -1, - (wxObject *) NULL, - _("Delete selected"), - _("Delete files and directories from version control")); - - toolBar->AddTool (ID_Update, - EMBEDDED_BITMAP(update_png), - wxNullBitmap, - FALSE, - -1, - -1, - (wxObject *) NULL, - _("Update selected"), - _("Bring changes from the repository into the working copy")); - - toolBar->AddTool (ID_Commit, - EMBEDDED_BITMAP(commit_png), - wxNullBitmap, - FALSE, - -1, - -1, - (wxObject *) NULL, - _("Commit selected"), - _("Send changes from your working copy to the repository")); - - toolBar->AddTool (ID_Revert, - EMBEDDED_BITMAP(revert_png), - wxNullBitmap, - FALSE, - -1, - -1, - (wxObject *) NULL, - _("Revert selected"), - _("Restore pristine working copy file (undo all local edits)")); - - toolBar->AddTool (ID_Resolve, - EMBEDDED_BITMAP(resolve_png), - wxNullBitmap, - FALSE, - -1, - -1, - (wxObject *) NULL, - _("Resolve selected"), - _("Remove 'conflicted' state on working copy files or directories")); - - toolBar->AddSeparator (); + AddActionTools(wxToolBarBase *toolBar) + { + wxASSERT(toolBar); + + toolBar->AddTool(ID_Add, + EMBEDDED_BITMAP(add_png), + wxNullBitmap, + FALSE, + -1, + -1, + (wxObject *) NULL, + _("Add selected"), + _("Put files and directories under revision control")); + + toolBar->AddTool(ID_Delete, + EMBEDDED_BITMAP(delete_png), + wxNullBitmap, + FALSE, + -1, + -1, + (wxObject *) NULL, + _("Delete selected"), + _("Delete files and directories from version control")); + + toolBar->AddTool(ID_Update, + EMBEDDED_BITMAP(update_png), + wxNullBitmap, + FALSE, + -1, + -1, + (wxObject *) NULL, + _("Update selected"), + _("Bring changes from the repository into the working copy")); + + toolBar->AddTool(ID_Commit, + EMBEDDED_BITMAP(commit_png), + wxNullBitmap, + FALSE, + -1, + -1, + (wxObject *) NULL, + _("Commit selected"), + _("Send changes from your working copy to the repository")); + + toolBar->AddTool(ID_Revert, + EMBEDDED_BITMAP(revert_png), + wxNullBitmap, + FALSE, + -1, + -1, + (wxObject *) NULL, + _("Revert selected"), + _("Restore pristine working copy file (undo all local edits)")); + + toolBar->AddTool(ID_Resolve, + EMBEDDED_BITMAP(resolve_png), + wxNullBitmap, + FALSE, + -1, + -1, + (wxObject *) NULL, + _("Resolve selected"), + _("Remove 'conflicted' state on working copy files or directories")); + + toolBar->AddSeparator(); } void - AddInfoTools (wxToolBarBase *toolBar) + AddInfoTools(wxToolBarBase *toolBar) { - toolBar->AddTool (ID_Info, - EMBEDDED_BITMAP(info_png), - wxNullBitmap, - FALSE, - -1, - -1, - (wxObject *) NULL, - _("Info selected"), - _("Display info about selected entries")); + toolBar->AddTool(ID_Info, + EMBEDDED_BITMAP(info_png), + wxNullBitmap, + FALSE, + -1, + -1, + (wxObject *) NULL, + _("Info selected"), + _("Display info about selected entries")); - toolBar->AddTool (ID_Log, - EMBEDDED_BITMAP(log_png), - wxNullBitmap, - FALSE, - -1, - -1, - (wxObject *) NULL, - _("Log selected"), - _("Show the log messages for the selected entries")); + toolBar->AddTool(ID_Log, + EMBEDDED_BITMAP(log_png), + wxNullBitmap, + FALSE, + -1, + -1, + (wxObject *) NULL, + _("Log selected"), + _("Show the log messages for the selected entries")); - toolBar->AddSeparator (); + toolBar->AddSeparator(); } - /** + /** * Checks whether @ref currenPath is an URL * * @retval true valid URL */ bool - IsUrl () const + IsUrl() const { - return svn::Url::isValid (LocalToUtf8(currentPath).c_str ()); + return svn::Url::isValid(LocalToUtf8(currentPath).c_str()); } @@ -633,12 +633,12 @@ struct RapidSvnFrame::Data * @retval true yes, it's flat */ bool - IsFlat () const + IsFlat() const { if (!listCtrl) return 0; - return listCtrl->IsFlat (); + return listCtrl->IsFlat(); } @@ -652,7 +652,7 @@ struct RapidSvnFrame::Data * @retval true there is an error dialog showing */ bool - IsErrorDialogActive () const + IsErrorDialogActive() const { return m_isErrorDialogActive; } @@ -666,10 +666,10 @@ struct RapidSvnFrame::Data * @param msg Error message to display */ void - ShowErrorDialog (const wxString & msg) + ShowErrorDialog(const wxString & msg) { m_isErrorDialogActive = true; - wxMessageBox (msg, _("RapidSVN Error"), wxICON_ERROR | wxOK); + wxMessageBox(msg, _("RapidSVN Error"), wxICON_ERROR | wxOK); m_isErrorDialogActive = false; } @@ -680,14 +680,14 @@ struct RapidSvnFrame::Data * @param msg message to show */ void - Trace (const wxString & msg) + Trace(const wxString & msg) { if (!log) return; - log->AppendText (msg + wxT('\n')); + log->AppendText(msg + wxT('\n')); } - + /** * add error message to log window marked red * @@ -696,200 +696,200 @@ struct RapidSvnFrame::Data * (besides logging this) */ void - TraceError (const wxString & msg, bool showDialog=true) + TraceError(const wxString & msg, bool showDialog=true) { if (!log) return; log->SetDefaultStyle(wxTextAttr(*wxRED)); - log->AppendText (wxString::Format (_("Error: %s\n"), msg.c_str ())); + log->AppendText(wxString::Format(_("Error: %s\n"), msg.c_str())); log->SetDefaultStyle(wxTextAttr(*wxBLACK)); if (showDialog) - ShowErrorDialog (msg); + ShowErrorDialog(msg); } const svn::StatusSel & - GetStatusSel () const + GetStatusSel() const { //is there nothing selected in the list control, //or is the active window *not* the list control? - if (listCtrl->GetSelectedItemCount () <= 0 || + if (listCtrl->GetSelectedItemCount() <= 0 || activePane != ACTIVEPANE_FILELIST) { - return folderBrowser->GetStatusSel (); + return folderBrowser->GetStatusSel(); } else { //no, build the file list from the list control - return listCtrl->GetStatusSel (); + return listCtrl->GetStatusSel(); } } }; -BEGIN_EVENT_TABLE (RapidSvnFrame, wxFrame) - EVT_ACTIVATE (RapidSvnFrame::OnActivate) - EVT_MENU (ID_AddWcBookmark, RapidSvnFrame::OnAddWcBookmark) - EVT_MENU (ID_AddRepoBookmark, RapidSvnFrame::OnAddRepoBookmark) - EVT_MENU (ID_RemoveBookmark, RapidSvnFrame::OnRemoveBookmark) - EVT_MENU (ID_EditBookmark, RapidSvnFrame::OnEditBookmark) - EVT_MENU (ID_Quit, RapidSvnFrame::OnQuit) - - EVT_MENU (ID_Preferences, RapidSvnFrame::OnPreferences) - EVT_MENU (ID_Refresh, RapidSvnFrame::OnRefresh) - EVT_UPDATE_UI (ID_Refresh, RapidSvnFrame::OnUpdateCommand) - - EVT_MENU (ID_Column_Reset, RapidSvnFrame::OnColumnReset) - EVT_MENU_RANGE (ID_Column_Min, ID_Column_Max, RapidSvnFrame::OnColumn) - EVT_MENU (ID_Include_Path, RapidSvnFrame::OnIncludePath) - EVT_MENU (ID_Sort_Ascending, RapidSvnFrame::OnSortAscending) - EVT_MENU_RANGE (ID_ColumnSort_Min, ID_ColumnSort_Max, RapidSvnFrame::OnColumnSorting) - - EVT_MENU (ID_Flat, RapidSvnFrame::OnFlatView) - EVT_MENU (ID_RefreshWithUpdate, RapidSvnFrame::OnRefreshWithUpdate) - EVT_MENU (ID_ShowUnversioned, RapidSvnFrame::OnShowUnversioned) - EVT_MENU (ID_IgnoreExternals, RapidSvnFrame::OnIgnoreExternals) - EVT_MENU (ID_ShowIgnored, RapidSvnFrame::OnShowIgnored) - EVT_MENU (ID_ShowUnmodified, RapidSvnFrame::OnShowUnmodified) - EVT_MENU (ID_ShowModified, RapidSvnFrame::OnShowModified) - EVT_MENU (ID_ShowConflicted, RapidSvnFrame::OnShowConflicted) - - EVT_MENU (ID_Login, RapidSvnFrame::OnLogin) - EVT_MENU (ID_Logout, RapidSvnFrame::OnLogout) - EVT_MENU (ID_Stop, RapidSvnFrame::OnStop) - - EVT_MENU (ID_Info, RapidSvnFrame::OnInfo) - EVT_UPDATE_UI (ID_Info, RapidSvnFrame::OnUpdateCommand) - - EVT_MENU (ID_HelpContents, RapidSvnFrame::OnHelpContents) - EVT_MENU (ID_HelpIndex, RapidSvnFrame::OnHelpIndex) - EVT_MENU (ID_HelpStartupTips, RapidSvnFrame::OnHelpStartupTips) - EVT_MENU (ID_About, RapidSvnFrame::OnAbout) +BEGIN_EVENT_TABLE(RapidSvnFrame, wxFrame) + EVT_ACTIVATE(RapidSvnFrame::OnActivate) + EVT_MENU(ID_AddWcBookmark, RapidSvnFrame::OnAddWcBookmark) + EVT_MENU(ID_AddRepoBookmark, RapidSvnFrame::OnAddRepoBookmark) + EVT_MENU(ID_RemoveBookmark, RapidSvnFrame::OnRemoveBookmark) + EVT_MENU(ID_EditBookmark, RapidSvnFrame::OnEditBookmark) + EVT_MENU(ID_Quit, RapidSvnFrame::OnQuit) -#ifdef USE_DEBUG_TESTS - EVT_MENU (ID_TestNewWxString, RapidSvnFrame::OnTestNewWxString) - EVT_MENU (ID_TestListener, RapidSvnFrame::OnTestListener) - EVT_MENU (ID_TestCheckout, RapidSvnFrame::OnTestCheckout) -#endif + EVT_MENU(ID_Preferences, RapidSvnFrame::OnPreferences) + EVT_MENU(ID_Refresh, RapidSvnFrame::OnRefresh) + EVT_UPDATE_UI(ID_Refresh, RapidSvnFrame::OnUpdateCommand) + + EVT_MENU(ID_Column_Reset, RapidSvnFrame::OnColumnReset) + EVT_MENU_RANGE(ID_Column_Min, ID_Column_Max, RapidSvnFrame::OnColumn) + EVT_MENU(ID_Include_Path, RapidSvnFrame::OnIncludePath) + EVT_MENU(ID_Sort_Ascending, RapidSvnFrame::OnSortAscending) + EVT_MENU_RANGE(ID_ColumnSort_Min, ID_ColumnSort_Max, RapidSvnFrame::OnColumnSorting) + + EVT_MENU(ID_Flat, RapidSvnFrame::OnFlatView) + EVT_MENU(ID_RefreshWithUpdate, RapidSvnFrame::OnRefreshWithUpdate) + EVT_MENU(ID_ShowUnversioned, RapidSvnFrame::OnShowUnversioned) + EVT_MENU(ID_IgnoreExternals, RapidSvnFrame::OnIgnoreExternals) + EVT_MENU(ID_ShowIgnored, RapidSvnFrame::OnShowIgnored) + EVT_MENU(ID_ShowUnmodified, RapidSvnFrame::OnShowUnmodified) + EVT_MENU(ID_ShowModified, RapidSvnFrame::OnShowModified) + EVT_MENU(ID_ShowConflicted, RapidSvnFrame::OnShowConflicted) - EVT_MENU_RANGE (ID_File_Min, ID_File_Max, RapidSvnFrame::OnFileCommand) - EVT_MENU_RANGE (ID_Verb_Min, ID_Verb_Max, RapidSvnFrame::OnFileCommand) + EVT_MENU(ID_Login, RapidSvnFrame::OnLogin) + EVT_MENU(ID_Logout, RapidSvnFrame::OnLogout) + EVT_MENU(ID_Stop, RapidSvnFrame::OnStop) - EVT_UPDATE_UI_RANGE (ID_File_Min, ID_File_Max, RapidSvnFrame::OnUpdateCommand) - EVT_UPDATE_UI_RANGE (ID_Verb_Min, ID_Verb_Max, RapidSvnFrame::OnUpdateCommand) - EVT_UPDATE_UI_RANGE (ID_Filter_Min, ID_Filter_Max, RapidSvnFrame::OnUpdateCommand) + EVT_MENU(ID_Info, RapidSvnFrame::OnInfo) + EVT_UPDATE_UI(ID_Info, RapidSvnFrame::OnUpdateCommand) - EVT_MENU (ACTION_EVENT, RapidSvnFrame::OnActionEvent) + EVT_MENU(ID_HelpContents, RapidSvnFrame::OnHelpContents) + EVT_MENU(ID_HelpIndex, RapidSvnFrame::OnHelpIndex) + EVT_MENU(ID_HelpStartupTips, RapidSvnFrame::OnHelpStartupTips) + EVT_MENU(ID_About, RapidSvnFrame::OnAbout) - EVT_TOOL_ENTER (ID_TOOLBAR, RapidSvnFrame::OnToolEnter) - EVT_TREE_SEL_CHANGED (-1, RapidSvnFrame::OnFolderBrowserSelChanged) - EVT_TREE_KEY_DOWN (-1, RapidSvnFrame::OnFolderBrowserKeyDown) - EVT_LIST_ITEM_SELECTED (-1, RapidSvnFrame::OnFileListSelected) + #ifdef USE_DEBUG_TESTS + EVT_MENU(ID_TestNewWxString, RapidSvnFrame::OnTestNewWxString) + EVT_MENU(ID_TestListener, RapidSvnFrame::OnTestListener) + EVT_MENU(ID_TestCheckout, RapidSvnFrame::OnTestCheckout) + #endif - EVT_MENU_RANGE (LISTENER_MIN, LISTENER_MAX, RapidSvnFrame::OnListenerEvent) + EVT_MENU_RANGE(ID_File_Min, ID_File_Max, RapidSvnFrame::OnFileCommand) + EVT_MENU_RANGE(ID_Verb_Min, ID_Verb_Max, RapidSvnFrame::OnFileCommand) - EVT_SIZE (RapidSvnFrame::OnSize) + EVT_UPDATE_UI_RANGE(ID_File_Min, ID_File_Max, RapidSvnFrame::OnUpdateCommand) + EVT_UPDATE_UI_RANGE(ID_Verb_Min, ID_Verb_Max, RapidSvnFrame::OnUpdateCommand) + EVT_UPDATE_UI_RANGE(ID_Filter_Min, ID_Filter_Max, RapidSvnFrame::OnUpdateCommand) - EVT_MENU (FOLDER_BROWSER, RapidSvnFrame::OnFocusChanged) - EVT_MENU (FILELIST_CTRL, RapidSvnFrame::OnFocusChanged) -END_EVENT_TABLE () + EVT_MENU(ACTION_EVENT, RapidSvnFrame::OnActionEvent) + + EVT_TOOL_ENTER(ID_TOOLBAR, RapidSvnFrame::OnToolEnter) + EVT_TREE_SEL_CHANGED(-1, RapidSvnFrame::OnFolderBrowserSelChanged) + EVT_TREE_KEY_DOWN(-1, RapidSvnFrame::OnFolderBrowserKeyDown) + EVT_LIST_ITEM_SELECTED(-1, RapidSvnFrame::OnFileListSelected) + + EVT_MENU_RANGE(LISTENER_MIN, LISTENER_MAX, RapidSvnFrame::OnListenerEvent) + + EVT_SIZE(RapidSvnFrame::OnSize) + + EVT_MENU(FOLDER_BROWSER, RapidSvnFrame::OnFocusChanged) + EVT_MENU(FILELIST_CTRL, RapidSvnFrame::OnFocusChanged) +END_EVENT_TABLE() /** class implementation **/ -RapidSvnFrame::RapidSvnFrame (const wxString & title, - const wxLocale & locale) - : wxFrame ((wxFrame *) NULL, -1, title, wxDefaultPosition, wxDefaultSize, - wxDEFAULT_FRAME_STYLE), - m_title (title), m_context (0) +RapidSvnFrame::RapidSvnFrame(const wxString & title, + const wxLocale & locale) + : wxFrame((wxFrame *) NULL, -1, title, wxDefaultPosition, wxDefaultSize, + wxDEFAULT_FRAME_STYLE), + m_title(title), m_context(0) { - m = new Data (this, locale); - m_actionWorker = CreateActionWorker (this); + m = new Data(this, locale); + m_actionWorker = CreateActionWorker(this); // enable trace - wxLog::AddTraceMask (TraceMisc); + wxLog::AddTraceMask(TraceMisc); // Retrieve a pointer to the application configuration object. // If the object is not created, it will be created upon the first // call to Get(). - wxConfigBase *cfg = wxConfigBase::Get (); + wxConfigBase *cfg = wxConfigBase::Get(); // Now set icons for the application // (several sizes are available OS/windowing system // picks whatever it thinks is suitable) wxIconBundle iconBundle; - iconBundle.AddIcon (wxIcon (rapidsvn_16x16_xpm)); - iconBundle.AddIcon (wxIcon (rapidsvn_32x32_xpm)); - iconBundle.AddIcon (wxIcon (rapidsvn_48x48_xpm)); - SetIcons (iconBundle); + iconBundle.AddIcon(wxIcon(rapidsvn_16x16_xpm)); + iconBundle.AddIcon(wxIcon(rapidsvn_32x32_xpm)); + iconBundle.AddIcon(wxIcon(rapidsvn_48x48_xpm)); + SetIcons(iconBundle); // toolbar rows m_toolbar_rows = 1; - SetMenuBar (m->MenuBar); - CreateStatusBar (); + SetMenuBar(m->MenuBar); + CreateStatusBar(); // Create the toolbar - m->RecreateToolbar (); - m->SetRunning (false); + m->RecreateToolbar(); + m->SetRunning(false); // Note: In the past here was an #if that checked // the wxWidgets version, since wxSplitterWindow // wasnt available below 2.4.2 (if I remember this correctly). // But today we only use wxSplitterWindow - m->horizSplitter = new wxSplitterWindow (this, -1, - wxDefaultPosition, - wxDefaultSize, - SPLITTER_STYLE); + m->horizSplitter = new wxSplitterWindow(this, -1, + wxDefaultPosition, + wxDefaultSize, + SPLITTER_STYLE); - m_info_panel = new wxPanel (m->horizSplitter, -1, - wxDefaultPosition, wxDefaultSize, - wxTAB_TRAVERSAL | wxCLIP_CHILDREN); + m_info_panel = new wxPanel(m->horizSplitter, -1, + wxDefaultPosition, wxDefaultSize, + wxTAB_TRAVERSAL | wxCLIP_CHILDREN); - m->log = new wxTextCtrl (m->horizSplitter, -1, wxEmptyString, - wxPoint (0, 0), wxDefaultSize, + m->log = new wxTextCtrl(m->horizSplitter, -1, wxEmptyString, + wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY); // as much as the widget can stand - m->log->SetMaxLength (0); + m->log->SetMaxLength(0); - m->logTracer = new EventTracer (this); - m->listener.SetTracer (m->logTracer, false); + m->logTracer = new EventTracer(this); + m->listener.SetTracer(m->logTracer, false); - m->vertSplitter = new wxSplitterWindow (m_info_panel, -1, - wxDefaultPosition, - wxDefaultSize, - SPLITTER_STYLE); + m->vertSplitter = new wxSplitterWindow(m_info_panel, -1, + wxDefaultPosition, + wxDefaultSize, + SPLITTER_STYLE); // Create the list control to display files - m->listCtrl = new FileListCtrl (m->vertSplitter, FILELIST_CTRL, + m->listCtrl = new FileListCtrl(m->vertSplitter, FILELIST_CTRL, wxDefaultPosition, wxDefaultSize); - m->CheckMenu (ID_Flat, false); - m->CheckMenu (ID_RefreshWithUpdate, m->listCtrl->GetWithUpdate()); - m->SetMenuAndTool (ID_ShowUnversioned, m->showUnversioned, - m->listCtrl->GetShowUnversioned()); - m->SetMenuAndTool (ID_ShowUnmodified, m->showUnmodified, true); - m->SetMenuAndTool (ID_ShowModified, m->showModified, true); - m->SetMenuAndTool (ID_ShowConflicted, m->showConflicted, true); - m->CheckMenu (ID_IgnoreExternals, m->listCtrl->GetIgnoreExternals()); - m->CheckMenu (ID_ShowIgnored, m->listCtrl->GetShowIgnored()); - m->CheckMenu (ID_Sort_Ascending, m->listCtrl->GetSortAscending()); - m->CheckSort (m->listCtrl->GetSortColumn() + ID_ColumnSort_Min + 1); - m->listCtrl->SetShowUnmodified (true); - m->listCtrl->SetShowModified (true); - m->listCtrl->SetShowConflicted (true); - - bool isFlat = m->listCtrl->IsFlat (); - bool includePath = m->listCtrl->GetIncludePath (); + m->CheckMenu(ID_Flat, false); + m->CheckMenu(ID_RefreshWithUpdate, m->listCtrl->GetWithUpdate()); + m->SetMenuAndTool(ID_ShowUnversioned, m->showUnversioned, + m->listCtrl->GetShowUnversioned()); + m->SetMenuAndTool(ID_ShowUnmodified, m->showUnmodified, true); + m->SetMenuAndTool(ID_ShowModified, m->showModified, true); + m->SetMenuAndTool(ID_ShowConflicted, m->showConflicted, true); + m->CheckMenu(ID_IgnoreExternals, m->listCtrl->GetIgnoreExternals()); + m->CheckMenu(ID_ShowIgnored, m->listCtrl->GetShowIgnored()); + m->CheckMenu(ID_Sort_Ascending, m->listCtrl->GetSortAscending()); + m->CheckSort(m->listCtrl->GetSortColumn() + ID_ColumnSort_Min + 1); + m->listCtrl->SetShowUnmodified(true); + m->listCtrl->SetShowModified(true); + m->listCtrl->SetShowConflicted(true); + + bool isFlat = m->listCtrl->IsFlat(); + bool includePath = m->listCtrl->GetIncludePath(); if (isFlat == false && includePath == true) - m->CheckMenu (ID_Include_Path, false); + m->CheckMenu(ID_Include_Path, false); else - m->CheckMenu (ID_Include_Path, includePath); - m->EnableMenuEntry (ID_Include_Path, isFlat ? true : false); + m->CheckMenu(ID_Include_Path, includePath); + m->EnableMenuEntry(ID_Include_Path, isFlat ? true : false); // Create the browse control - m->folderBrowser = new FolderBrowser (m->vertSplitter, FOLDER_BROWSER); + m->folderBrowser = new FolderBrowser(m->vertSplitter, FOLDER_BROWSER); // Adapt the menu entries for (int col=0; col < FileListCtrl::COL_COUNT; col++) @@ -898,64 +898,64 @@ RapidSvnFrame::RapidSvnFrame (const wxString & title, int sortid = id + Columns::SORT_COLUMN_OFFSET; if (id != ID_Column_Name && id != ID_Column_Path) { - bool check = m->listCtrl->GetColumnVisible (col); - m->CheckColumn (id, check); - m->EnableMenuEntry (sortid, check); + bool check = m->listCtrl->GetColumnVisible(col); + m->CheckColumn(id, check); + m->EnableMenuEntry(sortid, check); } } - RefreshFileList (); + RefreshFileList(); - wxSizer *sizer = new wxBoxSizer (wxVERTICAL); - sizer->Add (m->vertSplitter, 1, wxEXPAND); + wxSizer *sizer = new wxBoxSizer(wxVERTICAL); + sizer->Add(m->vertSplitter, 1, wxEXPAND); - m_info_panel->SetAutoLayout (true); - m_info_panel->SetSizer (sizer); + m_info_panel->SetAutoLayout(true); + m_info_panel->SetSizer(sizer); // Read frame position - if (cfg->Read (ConfigMaximized, (long int)0) == 1) - Maximize (true); + if (cfg->Read(ConfigMaximized, (long int)0) == 1) + Maximize(true); else { - int x = cfg->Read (ConfigLeft, 50); - int y = cfg->Read (ConfigTop, 50); - int w = cfg->Read (ConfigWidth, 806); - int h = cfg->Read (ConfigHeight, 480); + int x = cfg->Read(ConfigLeft, 50); + int y = cfg->Read(ConfigTop, 50); + int w = cfg->Read(ConfigWidth, 806); + int h = cfg->Read(ConfigHeight, 480); - Move (x, y); - SetClientSize (w, h); + Move(x, y); + SetClientSize(w, h); } // Get sash position for every splitter from configuration. int w,h; - GetClientSize (&w, &h); - int vpos = cfg->Read (ConfigSplitterVert, w / 3); - int hpos = cfg->Read (ConfigSplitterHoriz, (3 * h) / 4); + GetClientSize(&w, &h); + int vpos = cfg->Read(ConfigSplitterVert, w / 3); + int hpos = cfg->Read(ConfigSplitterHoriz, (3 * h) / 4); // initialize the folder browser - m->folderBrowser->ReadConfig (cfg); + m->folderBrowser->ReadConfig(cfg); { Preferences prefs; - m->folderBrowser->SetListener (&m->listener); - m->folderBrowser->SetAuthCache (prefs.useAuthCache); - m->folderBrowser->SetAuthPerBookmark (prefs.authPerBookmark); + m->folderBrowser->SetListener(&m->listener); + m->folderBrowser->SetAuthCache(prefs.useAuthCache); + m->folderBrowser->SetAuthPerBookmark(prefs.authPerBookmark); } - UpdateCurrentPath (); - RefreshFolderBrowser (); + UpdateCurrentPath(); + RefreshFolderBrowser(); // Set sash position for every splitter. // Note: do not revert the order of Split calls, as the panels will be messed up. - m->horizSplitter->SplitHorizontally (m_info_panel, m->log, hpos); - m->vertSplitter->SplitVertically (m->folderBrowser, m->listCtrl, vpos); + m->horizSplitter->SplitHorizontally(m_info_panel, m->log, hpos); + m->vertSplitter->SplitVertically(m->folderBrowser, m->listCtrl, vpos); // Initialize for drag and drop - m->folderBrowser->SetDropTarget (new FolderBrowserDropTarget (m->folderBrowser)); - m->listCtrl->SetDropTarget (new FileListCtrlDropTarget (m->folderBrowser, m->listCtrl)); + m->folderBrowser->SetDropTarget(new FolderBrowserDropTarget(m->folderBrowser)); + m->listCtrl->SetDropTarget(new FileListCtrlDropTarget(m->folderBrowser, m->listCtrl)); } -RapidSvnFrame::~RapidSvnFrame () +RapidSvnFrame::~RapidSvnFrame() { - wxConfigBase *cfg = wxConfigBase::Get (); + wxConfigBase *cfg = wxConfigBase::Get(); if (cfg == NULL) return; @@ -968,60 +968,60 @@ RapidSvnFrame::~RapidSvnFrame () // Save frame size and position. if (!IsIconized()) { - if (IsMaximized ()) - cfg->Write (ConfigMaximized, 1); + if (IsMaximized()) + cfg->Write(ConfigMaximized, 1); else { int x, y; int w, h; - GetClientSize (&w, &h); - GetPosition (&x, &y); + GetClientSize(&w, &h); + GetPosition(&x, &y); - cfg->Write (ConfigMaximized, 0); - cfg->Write (ConfigLeft, (long) x); - cfg->Write (ConfigTop, (long) y); - cfg->Write (ConfigWidth, (long) w); - cfg->Write (ConfigHeight, (long) h); + cfg->Write(ConfigMaximized, 0); + cfg->Write(ConfigLeft, (long) x); + cfg->Write(ConfigTop, (long) y); + cfg->Write(ConfigWidth, (long) w); + cfg->Write(ConfigHeight, (long) h); } } // Save splitter positions - cfg->Write (ConfigSplitterVert, - (long) m->vertSplitter->GetSashPosition ()); - cfg->Write (ConfigSplitterHoriz, - (long) m->horizSplitter->GetSashPosition ()); + cfg->Write(ConfigSplitterVert, + (long) m->vertSplitter->GetSashPosition()); + cfg->Write(ConfigSplitterHoriz, + (long) m->horizSplitter->GetSashPosition()); - m->folderBrowser->WriteConfig (cfg); + m->folderBrowser->WriteConfig(cfg); delete m; } void -RapidSvnFrame::SetActivePane (ActivePane value) +RapidSvnFrame::SetActivePane(ActivePane value) { m->activePane = value; } void -RapidSvnFrame::TrimDisabledMenuItems (wxMenu & menu) +RapidSvnFrame::TrimDisabledMenuItems(wxMenu & menu) { // Check for disabled items - size_t pos = menu.GetMenuItemCount (); + size_t pos = menu.GetMenuItemCount(); // TODO unsigned int selectionActionFlags = GetSelectionActionFlags (); - const svn::StatusSel & statusSel = m->GetStatusSel (); + const svn::StatusSel & statusSel = m->GetStatusSel(); while (pos-- > 0) { - wxMenuItem *pItem = menu.FindItemByPosition (pos); - if (!pItem->IsSeparator () && - !ActionFactory::CheckIdForStatusSel (pItem->GetId (), statusSel)) + wxMenuItem *pItem = menu.FindItemByPosition(pos); + if (!pItem->IsSeparator() && + !ActionFactory::CheckIdForStatusSel(pItem->GetId(), statusSel)) { - menu.Destroy (pItem); + menu.Destroy(pItem); } } // Trim unnecessary separators - pos = menu.GetMenuItemCount (); + pos = menu.GetMenuItemCount(); if (0 == pos) return; @@ -1029,8 +1029,8 @@ RapidSvnFrame::TrimDisabledMenuItems (wxMenu & menu) bool sepNeeded = false; while (pos-- > 0) { - wxMenuItem *pItem = menu.FindItemByPosition (pos); - if (pItem->IsSeparator ()) + wxMenuItem *pItem = menu.FindItemByPosition(pos); + if (pItem->IsSeparator()) { // If we're at a separator at the top, trash it & look for any more we skipped along the way if (pos == 0) @@ -1045,7 +1045,7 @@ RapidSvnFrame::TrimDisabledMenuItems (wxMenu & menu) } else { - menu.Destroy (pItem); + menu.Destroy(pItem); } } else @@ -1056,14 +1056,14 @@ RapidSvnFrame::TrimDisabledMenuItems (wxMenu & menu) } void -RapidSvnFrame::RefreshFileList () +RapidSvnFrame::RefreshFileList() { if (m->dontUpdateFilelist) return; - bool isRunning = m->IsRunning (); + bool isRunning = m->IsRunning(); if (!isRunning) - m->SetRunning (true); + m->SetRunning(true); if (m->listCtrl && m->folderBrowser) { @@ -1074,69 +1074,69 @@ RapidSvnFrame::RefreshFileList () // UPDATE /** * @todo THIS IS A WORKAOUND: - * Without real information to display in the - * filelist (e.g. the "Bookmarks" symbol) we + * Without real information to display in the + * filelist (e.g. the "Bookmarks" symbol) we * could simply show a grey background. * In the past we simpy used Show (FALSE). * But this caused in the right area not being - * updated at all. - * Either we have to so something special with + * updated at all. + * Either we have to so something special with * wxWidgets or this is a wxWidgets bug and will * be fixed in there */ - if (m->currentPath.length () == 0) + if (m->currentPath.length() == 0) { // calling "UpdateColumns" should be necessary // only for the first call. But without any // items this call should be cheap. - m->listCtrl->DeleteAllItems (); - m->listCtrl->UpdateColumns (); + m->listCtrl->DeleteAllItems(); + m->listCtrl->UpdateColumns(); } else { - m->listCtrl->SetContext (m_context); - m->listCtrl->RefreshFileList (m->currentPath); + m->listCtrl->SetContext(m_context); + m->listCtrl->RefreshFileList(m->currentPath); } } catch (svn::ClientException & e) { - wxString msg, errtxt (Utf8ToLocal (e.message ())); - msg.Printf (_("Error while updating filelist (%s)"), - errtxt.c_str ()); - m->TraceError (msg, false); + wxString msg, errtxt(Utf8ToLocal(e.message())); + msg.Printf(_("Error while updating filelist (%s)"), + errtxt.c_str()); + m->TraceError(msg, false); // calling "UpdateColumns" should be necessary // only for the first call. But without any // items this call should be cheap. - m->listCtrl->DeleteAllItems (); - m->listCtrl->UpdateColumns (); + m->listCtrl->DeleteAllItems(); + m->listCtrl->UpdateColumns(); } catch (...) { - m->TraceError (_("Error while updating filelist"), false); + m->TraceError(_("Error while updating filelist"), false); // calling "UpdateColumns" should be necessary // only for the first call. But without any // items this call should be cheap. - m->listCtrl->DeleteAllItems (); - m->listCtrl->UpdateColumns (); + m->listCtrl->DeleteAllItems(); + m->listCtrl->UpdateColumns(); } } if (!isRunning) - m->SetRunning (false); + m->SetRunning(false); } void -RapidSvnFrame::RefreshFolderBrowser () +RapidSvnFrame::RefreshFolderBrowser() { wxBusyCursor busy; - bool isRunning = m->IsRunning (); + bool isRunning = m->IsRunning(); if (!isRunning) - m->SetRunning (true); + m->SetRunning(true); try { @@ -1144,7 +1144,7 @@ RapidSvnFrame::RefreshFolderBrowser () m->dontUpdateFilelist = true; if (m->folderBrowser) - m->folderBrowser->RefreshFolderBrowser (); + m->folderBrowser->RefreshFolderBrowser(); } catch (...) { @@ -1152,12 +1152,12 @@ RapidSvnFrame::RefreshFolderBrowser () } if (!isRunning) - m->SetRunning (false); + m->SetRunning(false); if (!m->skipFilelistUpdate) { m->dontUpdateFilelist = false; - RefreshFileList (); + RefreshFileList(); } m->skipFilelistUpdate = false; } @@ -1165,7 +1165,7 @@ RapidSvnFrame::RefreshFolderBrowser () /*** START OF SECTION EVENTS ***/ void -RapidSvnFrame::OnActivate (wxActivateEvent & event) +RapidSvnFrame::OnActivate(wxActivateEvent & event) { // in the past we used to refresh only if we had // had an action which changed stuff. @@ -1174,17 +1174,17 @@ RapidSvnFrame::OnActivate (wxActivateEvent & event) // working copies and if NOT flat // and NOT if another action is running. wxFrame::OnActivate(event); - if (event.GetActive ()) + if (event.GetActive()) { - if (m->updateAfterActivate || - (!m->IsUrl () && - !m->IsFlat () && - !m->IsRunning () && - !m->IsErrorDialogActive ())) + if (m->updateAfterActivate || + (!m->IsUrl() && + !m->IsFlat() && + !m->IsRunning() && + !m->IsErrorDialogActive())) { m->updateAfterActivate = false; - RefreshFileList (); + RefreshFileList(); } } @@ -1195,69 +1195,69 @@ RapidSvnFrame::OnActivate (wxActivateEvent & event) } void -RapidSvnFrame::OnAddWcBookmark (wxCommandEvent & event) +RapidSvnFrame::OnAddWcBookmark(wxCommandEvent & event) { - AddWcBookmark (); + AddWcBookmark(); } void -RapidSvnFrame::OnAddRepoBookmark (wxCommandEvent & event) +RapidSvnFrame::OnAddRepoBookmark(wxCommandEvent & event) { - AddRepoBookmark (); + AddRepoBookmark(); } void -RapidSvnFrame::OnRemoveBookmark (wxCommandEvent & event) +RapidSvnFrame::OnRemoveBookmark(wxCommandEvent & event) { - RemoveBookmark (); + RemoveBookmark(); } -void -RapidSvnFrame::OnEditBookmark (wxCommandEvent & event) +void +RapidSvnFrame::OnEditBookmark(wxCommandEvent & event) { - EditBookmark (); + EditBookmark(); } void -RapidSvnFrame::OnQuit (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnQuit(wxCommandEvent & WXUNUSED(event)) { - Close (TRUE); + Close(TRUE); } void -RapidSvnFrame::OnPreferences (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnPreferences(wxCommandEvent & WXUNUSED(event)) { - ShowPreferences (); + ShowPreferences(); } void -RapidSvnFrame::OnRefresh (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnRefresh(wxCommandEvent & WXUNUSED(event)) { - RefreshFolderBrowser (); + RefreshFolderBrowser(); } void -RapidSvnFrame::OnColumnReset (wxCommandEvent &) +RapidSvnFrame::OnColumnReset(wxCommandEvent &) { - m->listCtrl->ResetColumns (); + m->listCtrl->ResetColumns(); for (int col = 0; col < FileListCtrl::COL_COUNT; col++) { - bool visible = m->listCtrl->GetColumnVisible (col); + bool visible = m->listCtrl->GetColumnVisible(col); int id = m->ColumnList [col].id; if (id != ID_Column_Name && id != ID_Column_Path) - m->CheckColumn (id, visible); + m->CheckColumn(id, visible); int sortid = id + Columns::SORT_COLUMN_OFFSET; - m->EnableMenuEntry (sortid, visible); + m->EnableMenuEntry(sortid, visible); } - RefreshFileList (); + RefreshFileList(); } void -RapidSvnFrame::OnColumn (wxCommandEvent & event) +RapidSvnFrame::OnColumn(wxCommandEvent & event) { - int eventId = event.GetId (); + int eventId = event.GetId(); int col = 0; while (col < FileListCtrl::COL_COUNT && m->ColumnList[col].id != eventId) @@ -1271,164 +1271,164 @@ RapidSvnFrame::OnColumn (wxCommandEvent & event) // Enable/disable the corresponding column. Automatically define // a new sorting column after an old one is disabled. bool visible = m->IsColumnChecked(eventId); - m->listCtrl->SetColumnVisible (col, visible); + m->listCtrl->SetColumnVisible(col, visible); int sortid = eventId + Columns::SORT_COLUMN_OFFSET; - m->EnableMenuEntry (sortid, visible); + m->EnableMenuEntry(sortid, visible); - UpdateMenuSorting (); - UpdateMenuAscending (); + UpdateMenuSorting(); + UpdateMenuAscending(); - RefreshFileList (); + RefreshFileList(); } } void -RapidSvnFrame::OnIncludePath (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnIncludePath(wxCommandEvent & WXUNUSED(event)) { - m->listCtrl->SetIncludePath (!m->listCtrl->GetIncludePath ()); + m->listCtrl->SetIncludePath(!m->listCtrl->GetIncludePath()); } void -RapidSvnFrame::OnSortAscending (wxCommandEvent & event) +RapidSvnFrame::OnSortAscending(wxCommandEvent & event) { - m->listCtrl->SetSortAscending (!m->listCtrl->GetSortAscending ()); + m->listCtrl->SetSortAscending(!m->listCtrl->GetSortAscending()); } void -RapidSvnFrame::OnColumnSorting (wxCommandEvent & event) +RapidSvnFrame::OnColumnSorting(wxCommandEvent & event) { // we dont want to list FileListCtrl::COL_NAME/COL_PATH/... here - int col = event.GetId () - ID_ColumnSort_Name; + int col = event.GetId() - ID_ColumnSort_Name; - m->listCtrl->SetSortColumn (col); - m->listCtrl->SetSortAscending (true); + m->listCtrl->SetSortColumn(col); + m->listCtrl->SetSortAscending(true); - UpdateMenuAscending (); + UpdateMenuAscending(); } void -RapidSvnFrame::OnFlatView (wxCommandEvent & event) +RapidSvnFrame::OnFlatView(wxCommandEvent & event) { - bool newFlatMode = !m->folderBrowser->IsFlat (); + bool newFlatMode = !m->folderBrowser->IsFlat(); // if this cannot be set (e.g. invalid selection // like the root element, we uncheck this - if (!m->folderBrowser->SetFlat (newFlatMode)) + if (!m->folderBrowser->SetFlat(newFlatMode)) newFlatMode = false; - m->CheckMenu (ID_Flat, newFlatMode); - m->listCtrl->SetFlat (newFlatMode); + m->CheckMenu(ID_Flat, newFlatMode); + m->listCtrl->SetFlat(newFlatMode); - SetIncludePathVisibility (newFlatMode); + SetIncludePathVisibility(newFlatMode); - RefreshFileList (); + RefreshFileList(); } void -RapidSvnFrame::OnRefreshWithUpdate (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnRefreshWithUpdate(wxCommandEvent & WXUNUSED(event)) { - bool checked = m->IsMenuChecked (ID_RefreshWithUpdate); - m->listCtrl->SetWithUpdate (checked); - RefreshFolderBrowser (); + bool checked = m->IsMenuChecked(ID_RefreshWithUpdate); + m->listCtrl->SetWithUpdate(checked); + RefreshFolderBrowser(); } void -RapidSvnFrame::OnShowUnversioned (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnShowUnversioned(wxCommandEvent & WXUNUSED(event)) { - bool checked = m->ToggleMenuAndTool (ID_ShowUnversioned, m->showUnversioned); - m->listCtrl->SetShowUnversioned (checked); - RefreshFileList (); + bool checked = m->ToggleMenuAndTool(ID_ShowUnversioned, m->showUnversioned); + m->listCtrl->SetShowUnversioned(checked); + RefreshFileList(); } -void -RapidSvnFrame::OnShowUnmodified (wxCommandEvent & WXUNUSED (event)) +void +RapidSvnFrame::OnShowUnmodified(wxCommandEvent & WXUNUSED(event)) { - bool checked = m->ToggleMenuAndTool (ID_ShowUnmodified, m->showUnmodified); - m->listCtrl->SetShowUnmodified (checked); - RefreshFileList (); + bool checked = m->ToggleMenuAndTool(ID_ShowUnmodified, m->showUnmodified); + m->listCtrl->SetShowUnmodified(checked); + RefreshFileList(); } -void -RapidSvnFrame::OnShowModified (wxCommandEvent & WXUNUSED (event)) +void +RapidSvnFrame::OnShowModified(wxCommandEvent & WXUNUSED(event)) { - bool checked = m->ToggleMenuAndTool (ID_ShowModified, m->showModified); - m->listCtrl->SetShowModified (checked); - RefreshFileList (); + bool checked = m->ToggleMenuAndTool(ID_ShowModified, m->showModified); + m->listCtrl->SetShowModified(checked); + RefreshFileList(); } -void -RapidSvnFrame::OnShowConflicted (wxCommandEvent & WXUNUSED (event)) +void +RapidSvnFrame::OnShowConflicted(wxCommandEvent & WXUNUSED(event)) { - bool checked = m->ToggleMenuAndTool (ID_ShowConflicted, m->showConflicted); - m->listCtrl->SetShowConflicted (checked); - RefreshFileList (); + bool checked = m->ToggleMenuAndTool(ID_ShowConflicted, m->showConflicted); + m->listCtrl->SetShowConflicted(checked); + RefreshFileList(); } void -RapidSvnFrame::OnIgnoreExternals (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnIgnoreExternals(wxCommandEvent & WXUNUSED(event)) { - bool checked = m->IsMenuChecked (ID_IgnoreExternals); - m->listCtrl->SetIgnoreExternals (checked); - RefreshFileList (); + bool checked = m->IsMenuChecked(ID_IgnoreExternals); + m->listCtrl->SetIgnoreExternals(checked); + RefreshFileList(); } void -RapidSvnFrame::OnShowIgnored (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnShowIgnored(wxCommandEvent & WXUNUSED(event)) { - bool checked = m->IsMenuChecked (ID_ShowIgnored); - m->listCtrl->SetShowIgnored (checked); - RefreshFileList (); + bool checked = m->IsMenuChecked(ID_ShowIgnored); + m->listCtrl->SetShowIgnored(checked); + RefreshFileList(); } void -RapidSvnFrame::OnLogin (wxCommandEvent & event) +RapidSvnFrame::OnLogin(wxCommandEvent & event) { - svn::Context * context = m->folderBrowser->GetContext (); + svn::Context * context = m->folderBrowser->GetContext(); if (context == 0) return; - wxString LocalUsername(Utf8ToLocal (context->getUsername ())); - AuthDlg dlg (this, LocalUsername); - bool ok = dlg.ShowModal () == wxID_OK; + wxString LocalUsername(Utf8ToLocal(context->getUsername())); + AuthDlg dlg(this, LocalUsername); + bool ok = dlg.ShowModal() == wxID_OK; if (ok) { std::string username, password; - LocalToUtf8 (dlg.GetUsername (), username); - LocalToUtf8 (dlg.GetPassword (), password); - context->setLogin (username.c_str (), password.c_str ()); + LocalToUtf8(dlg.GetUsername(), username); + LocalToUtf8(dlg.GetPassword(), password); + context->setLogin(username.c_str(), password.c_str()); } } void -RapidSvnFrame::OnLogout (wxCommandEvent & event) +RapidSvnFrame::OnLogout(wxCommandEvent & event) { - svn::Context * context = m->folderBrowser->GetContext (); + svn::Context * context = m->folderBrowser->GetContext(); if (context == 0) return; - context->setLogin ("", ""); + context->setLogin("", ""); } void -RapidSvnFrame::OnStop (wxCommandEvent & event) +RapidSvnFrame::OnStop(wxCommandEvent & event) { - m->listener.cancel (true); + m->listener.cancel(true); } void -RapidSvnFrame::OnInfo (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnInfo(wxCommandEvent & WXUNUSED(event)) { - ShowInfo (); + ShowInfo(); } void -RapidSvnFrame::OnUpdateCommand (wxUpdateUIEvent & updateUIEvent) +RapidSvnFrame::OnUpdateCommand(wxUpdateUIEvent & updateUIEvent) { if (m->IsRunning()) { updateUIEvent.Enable(false); @@ -1437,33 +1437,33 @@ RapidSvnFrame::OnUpdateCommand (wxUpdateUIEvent & updateUIEvent) try { - updateUIEvent.Enable ( - ActionFactory::CheckIdForStatusSel ( - updateUIEvent.GetId (), m->GetStatusSel ())); + updateUIEvent.Enable( + ActionFactory::CheckIdForStatusSel( + updateUIEvent.GetId(), m->GetStatusSel())); } catch (svn::ClientException & e) { - m->Trace (Utf8ToLocal (e.message ())); + m->Trace(Utf8ToLocal(e.message())); return; } catch (...) { - m->Trace (_("An error occurred while checking valid actions")); + m->Trace(_("An error occurred while checking valid actions")); } } void -RapidSvnFrame::OnHelpContents (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event)) { try { - OpenURL (wxT("http://www.rapidsvn.org/help/index.php?id=OnlineHelp:Contents")); + OpenURL(wxT("http://www.rapidsvn.org/help/index.php?id=OnlineHelp:Contents")); } - catch(...) + catch (...) { - m->Trace (_("An error occured while launching the browser")); + m->Trace(_("An error occured while launching the browser")); } - + // WE DONT USE THIS CODE NOW //#ifdef USE_HTML_HELP // ::wxGetApp ().GetHelpController().DisplayContents(); @@ -1472,15 +1472,15 @@ RapidSvnFrame::OnHelpContents (wxCommandEvent & WXUNUSED (event)) } void -RapidSvnFrame::OnHelpIndex (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnHelpIndex(wxCommandEvent & WXUNUSED(event)) { try { - OpenURL (wxT("http://www.rapidsvn.org/help/index.php?id=OnlineHelp:Index")); + OpenURL(wxT("http://www.rapidsvn.org/help/index.php?id=OnlineHelp:Index")); } - catch(...) + catch (...) { - m->Trace (_("An error occured while launching the browser")); + m->Trace(_("An error occured while launching the browser")); } //#ifdef USE_HTML_HELP @@ -1489,92 +1489,92 @@ RapidSvnFrame::OnHelpIndex (wxCommandEvent & WXUNUSED (event)) } void -RapidSvnFrame::OnHelpStartupTips (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnHelpStartupTips(wxCommandEvent & WXUNUSED(event)) { #ifdef USE_STARTUP_TIPS RapidSvnApp& app = ::wxGetApp(); - wxTipProvider* tipProvider = app.MakeTipProvider (true); + wxTipProvider* tipProvider = app.MakeTipProvider(true); if (tipProvider) { - bool showAtStartup = ::wxShowTip (this, tipProvider); - app.SaveTipsInfo (showAtStartup, tipProvider->GetCurrentTip ()); + bool showAtStartup = ::wxShowTip(this, tipProvider); + app.SaveTipsInfo(showAtStartup, tipProvider->GetCurrentTip()); delete tipProvider; } #endif } void -RapidSvnFrame::OnAbout (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnAbout(wxCommandEvent & WXUNUSED(event)) { - AboutDlg dlg (this, m->locale); + AboutDlg dlg(this, m->locale); - dlg.ShowModal (); + dlg.ShowModal(); } #ifdef USE_DEBUG_TESTS static void -info_print_time (apr_time_t atime, const wxChar * desc, wxString & str) +info_print_time(apr_time_t atime, const wxChar * desc, wxString & str) { apr_time_exp_t extime; apr_status_t apr_err; /* if this returns an error, just don't print anything out */ - apr_err = apr_time_exp_tz (&extime, atime, 0); + apr_err = apr_time_exp_tz(&extime, atime, 0); if (!apr_err) - str.Printf (wxT("%s: %02lu:%02lu:%02lu:%02lu"), desc, - (unsigned long) (extime.tm_hour), - (unsigned long) (extime.tm_min), - (unsigned long) (extime.tm_sec), - (unsigned long) (extime.tm_usec)); + str.Printf(wxT("%s: %02lu:%02lu:%02lu:%02lu"), desc, + (unsigned long)(extime.tm_hour), + (unsigned long)(extime.tm_min), + (unsigned long)(extime.tm_sec), + (unsigned long)(extime.tm_usec)); } void -RapidSvnFrame::PrintTimeMeasurements (apr_time_t start, apr_time_t end, const wxString & name) +RapidSvnFrame::PrintTimeMeasurements(apr_time_t start, apr_time_t end, const wxString & name) { - wxString msg (name); - Trace (wxT('\n') + msg); + wxString msg(name); + Trace(wxT('\n') + msg); - info_print_time (start, _("Test started at"), msg); - Trace (wxT("\n") + msg); + info_print_time(start, _("Test started at"), msg); + Trace(wxT("\n") + msg); - info_print_time (end, _("Test ended at"), msg); - Trace (msg); + info_print_time(end, _("Test ended at"), msg); + Trace(msg); apr_time_t duration = end - start; - info_print_time (duration, _("Test duration"), msg); - Trace (msg + wxT("\n")); + info_print_time(duration, _("Test duration"), msg); + Trace(msg + wxT("\n")); } void -RapidSvnFrame::OnTestNewWxString (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnTestNewWxString(wxCommandEvent & WXUNUSED(event)) { - apr_time_t start = apr_time_now (); + apr_time_t start = apr_time_now(); // starting the test for (int i = 1; i <= 10000; i++) { wxString message; - message.Printf (wxT("Tracing a message from newely created wxString, round #%d"), i); - Trace (message); + message.Printf(wxT("Tracing a message from newely created wxString, round #%d"), i); + Trace(message); - static apr_time_t last_access = apr_time_now (); - if (apr_time_now () - last_access > 2000000) + static apr_time_t last_access = apr_time_now(); + if (apr_time_now() - last_access > 2000000) { - last_access = apr_time_now (); - wxSafeYield (); + last_access = apr_time_now(); + wxSafeYield(); } } // ending the test - apr_time_t end = apr_time_now (); + apr_time_t end = apr_time_now(); - wxString name (wxT("Created 10 000 wxStrings and printed them with Trace ()")); - PrintTimeMeasurements (start, end, name); + wxString name(wxT("Created 10 000 wxStrings and printed them with Trace ()")); + PrintTimeMeasurements(start, end, name); } void -RapidSvnFrame::OnTestListener (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnTestListener(wxCommandEvent & WXUNUSED(event)) { - apr_time_t start = apr_time_now (); + apr_time_t start = apr_time_now(); // starting the test @@ -1613,71 +1613,71 @@ RapidSvnFrame::OnTestListener (wxCommandEvent & WXUNUSED (event)) _("Failed to lock"), // svn_wc_notify_failed_lock _("Failed to unlock") // svn_wc_notify_failed_unlock }; - + if (ACTION_NAMES[i] != NULL) { static wxString wxpath; - + #ifdef __WXMSW__ - wxpath = Utf8ToLocal ("O:/rapidsvn/TRANSLATIONS"); + wxpath = Utf8ToLocal("O:/rapidsvn/TRANSLATIONS"); #else - wxpath = Utf8ToLocal ("/home/sleepy/projects/rapidsvn/TRANSLATIONS"); -#endif + wxpath = Utf8ToLocal("/home/sleepy/projects/rapidsvn/TRANSLATIONS"); +#endif static wxString msg; - msg.Printf (wxT("%s: %s, %d"), ACTION_NAMES[i], wxpath.c_str (), j); - - Trace (msg); + msg.Printf(wxT("%s: %s, %d"), ACTION_NAMES[i], wxpath.c_str(), j); + + Trace(msg); } - static apr_time_t last_access = apr_time_now (); - if (apr_time_now () - last_access > 2000000) + static apr_time_t last_access = apr_time_now(); + if (apr_time_now() - last_access > 2000000) { - last_access = apr_time_now (); - wxSafeYield (); + last_access = apr_time_now(); + wxSafeYield(); } } } // ending the test - apr_time_t end = apr_time_now (); + apr_time_t end = apr_time_now(); - wxString name (wxT("Tested Listener, 1000 loops through all the 22/26 actions")); - PrintTimeMeasurements (start, end, name); + wxString name(wxT("Tested Listener, 1000 loops through all the 22/26 actions")); + PrintTimeMeasurements(start, end, name); } void -RapidSvnFrame::OnTestCheckout (wxCommandEvent & WXUNUSED (event)) +RapidSvnFrame::OnTestCheckout(wxCommandEvent & WXUNUSED(event)) { - apr_time_t start = apr_time_now (); + apr_time_t start = apr_time_now(); - Action * action = new CheckoutAction (this); + Action * action = new CheckoutAction(this); if (action) - Perform (action); + Perform(action); - apr_time_t end = apr_time_now (); - wxString name (wxT("Tested Checkout (works only in single-threaded version)")); - PrintTimeMeasurements (start, end, name); + apr_time_t end = apr_time_now(); + wxString name(wxT("Tested Checkout (works only in single-threaded version)")); + PrintTimeMeasurements(start, end, name); } #endif void -RapidSvnFrame::OnFileCommand (wxCommandEvent & event) +RapidSvnFrame::OnFileCommand(wxCommandEvent & event) { - int id = event.GetId (); + int id = event.GetId(); switch (id) { case ID_CreateRepository: - wxMessageBox ( -_("Please use the command line utility 'svnadmin'\n\ + wxMessageBox( + _("Please use the command line utility 'svnadmin'\n\ to create a new repository.\n\n\ This command line utility is not part of the\n\ RapidSVN distribution.\n\n\ More information about subversion:\n\ http://svnbook.red-bean.com/\n\ http://subversion.tigris.org"), - _("Information"), - wxOK); + _("Information"), + wxOK); break; case ID_Default_Action: @@ -1685,362 +1685,362 @@ More information about subversion:\n\ break; case ID_Mkdir: - Perform (new MkdirAction (this, m->currentPath)); + Perform(new MkdirAction(this, m->currentPath)); break; default: // Let the action factory decide - Action * action = ActionFactory::CreateAction (this, id); + Action * action = ActionFactory::CreateAction(this, id); if (action) - Perform (action); + Perform(action); else - m->logTracer->Trace (_("Unimplemented action!")); + m->logTracer->Trace(_("Unimplemented action!")); } } void -RapidSvnFrame::OnActionEvent (wxCommandEvent & event) +RapidSvnFrame::OnActionEvent(wxCommandEvent & event) { - const int token = event.GetInt (); + const int token = event.GetInt(); switch (token) { case TOKEN_INFO: - m->Trace (event.GetString ()); + m->Trace(event.GetString()); break; case TOKEN_ERROR: - m->TraceError (event.GetString ()); + m->TraceError(event.GetString()); break; case TOKEN_SVN_INTERNAL_ERROR: case TOKEN_INTERNAL_ERROR: - m->TraceError (event.GetString ()); - // Action is interrupted, so cancel listener + m->TraceError(event.GetString()); + // Action is interrupted, so cancel listener // (in order to enable filelist update) // and disable "Running" state - m->listener.cancel (false); - RefreshFileList (); - m->Trace (_("Ready\n")); - m->SetRunning (false); + m->listener.cancel(false); + RefreshFileList(); + m->Trace(_("Ready\n")); + m->SetRunning(false); break; case TOKEN_ACTION_START: - m->Trace (event.GetString ()); - wxLogStatus (event.GetString ()); + m->Trace(event.GetString()); + wxLogStatus(event.GetString()); break; case TOKEN_ACTION_END: + { + unsigned int* af = (unsigned int*) event.GetClientData(); + unsigned int actionFlags = 0; + if (af) { - unsigned int* af = (unsigned int*) event.GetClientData (); - unsigned int actionFlags = 0; - if (af) - { - actionFlags = *af; - delete af; - } - else - { - m->TraceError (_("Internal Error: no client data for action event!")); - } + actionFlags = *af; + delete af; + } + else + { + m->TraceError(_("Internal Error: no client data for action event!")); + } - if ((actionFlags & Action::UPDATE_LATER) != 0) + if ((actionFlags & Action::UPDATE_LATER) != 0) + { + // dont update immediately but set this + // marker to update right after + // the next time the app gets activated + m->updateAfterActivate = true; + } + else + { + if ((actionFlags & Action::UPDATE_TREE) != 0) { - // dont update immediately but set this - // marker to update right after - // the next time the app gets activated - m->updateAfterActivate = true; + m->Trace(_("Updating...")); + RefreshFolderBrowser(); } - else + else if ((actionFlags & Action::DONT_UPDATE) == 0) { - if ((actionFlags & Action::UPDATE_TREE) != 0) - { - m->Trace (_("Updating...")); - RefreshFolderBrowser (); - } - else if ((actionFlags & Action::DONT_UPDATE) == 0) - { - m->Trace (_("Updating...")); - RefreshFileList (); - } + m->Trace(_("Updating...")); + RefreshFileList(); } - - m->Trace (_("Ready\n")); - m->SetRunning (false); } - break; + + m->Trace(_("Ready\n")); + m->SetRunning(false); + } + break; case TOKEN_CMD: case TOKEN_CMD_DIFF: case TOKEN_CMD_MERGE: case TOKEN_CMD_VIEW: - { + { #ifdef _WIN32 - // recover initial environment - wxString apr_iconv_path; - bool saved_apr_iconv_path = false; - if (wxGetEnv (wxT("__SAVED_APR_ICONV_PATH"), &apr_iconv_path)) - { - saved_apr_iconv_path = true; - wxSetEnv (wxT("APR_ICONV_PATH"), apr_iconv_path.c_str ()); - wxUnsetEnv (wxT("__SAVED_APR_ICONV_PATH")); - } + // recover initial environment + wxString apr_iconv_path; + bool saved_apr_iconv_path = false; + if (wxGetEnv(wxT("__SAVED_APR_ICONV_PATH"), &apr_iconv_path)) + { + saved_apr_iconv_path = true; + wxSetEnv(wxT("APR_ICONV_PATH"), apr_iconv_path.c_str()); + wxUnsetEnv(wxT("__SAVED_APR_ICONV_PATH")); + } #endif - // execute the command sent - wxExecute (event.GetString ()); + // execute the command sent + wxExecute(event.GetString()); #ifdef _WIN32 - // set custom environment again - if (saved_apr_iconv_path) - { - wxSetEnv (wxT("__SAVED_APR_ICONV_PATH"), apr_iconv_path.c_str ()); - wxSetEnv (wxT("APR_ICONV_PATH"), wxStandardPaths::Get ().GetDataDir () + wxT("\\iconv")); - } -#endif - /** - * @todo Would be good to be able to interpret the return value - * to see if the command could be executed. - * The documentation on @a wxExecute teaches us 0 means - * process couldnt be created. But with Linux/wxGTK I got - * a positive integer even if the command couldnt be found. - * Another way to check this might be to explicitely scan - * the PATH variable to find the executable if a relative - * pathname is given. - */ - // not working code - // if (result != 0) - // { - // // 0 as return value means the command couldnt be executed - // TraceError (wxString::Format (_("Execution of command failed: '%s'"), - // event.GetString ().c_str ())); - // } + // set custom environment again + if (saved_apr_iconv_path) + { + wxSetEnv(wxT("__SAVED_APR_ICONV_PATH"), apr_iconv_path.c_str()); + wxSetEnv(wxT("APR_ICONV_PATH"), wxStandardPaths::Get().GetDataDir() + wxT("\\iconv")); } - break; +#endif + /** + * @todo Would be good to be able to interpret the return value + * to see if the command could be executed. + * The documentation on @a wxExecute teaches us 0 means + * process couldnt be created. But with Linux/wxGTK I got + * a positive integer even if the command couldnt be found. + * Another way to check this might be to explicitely scan + * the PATH variable to find the executable if a relative + * pathname is given. + */ + // not working code + // if (result != 0) + // { + // // 0 as return value means the command couldnt be executed + // TraceError (wxString::Format (_("Execution of command failed: '%s'"), + // event.GetString ().c_str ())); + // } + } + break; case TOKEN_VIEW: - { - GetData * pData = static_cast(event.GetClientData ()); + { + GetData * pData = static_cast(event.GetClientData()); - if (pData != 0) - { - // copy the data first. This makes sure - // the memory is released in the occurence - // of an exception - GetData data (*pData); - delete pData; - - Action * action = new ViewAction (this, data); - Perform (action); - } + if (pData != 0) + { + // copy the data first. This makes sure + // the memory is released in the occurence + // of an exception + GetData data(*pData); + delete pData; + + Action * action = new ViewAction(this, data); + Perform(action); } - break; + } + break; case TOKEN_ADD_BOOKMARK: - { - const wxString bookmark = event.GetString (); + { + const wxString bookmark = event.GetString(); - m->folderBrowser->AddBookmark (bookmark); - RefreshFolderBrowser (); - m->folderBrowser->SelectBookmark (bookmark); - UpdateCurrentPath (); - RefreshFileList (); - } - break; + m->folderBrowser->AddBookmark(bookmark); + RefreshFolderBrowser(); + m->folderBrowser->SelectBookmark(bookmark); + UpdateCurrentPath(); + RefreshFileList(); + } + break; case TOKEN_GET: - { - GetData * pData = static_cast(event.GetClientData ()); + { + GetData * pData = static_cast(event.GetClientData()); - if (pData != 0) - { - // copy the data first. This makes sure - // the memory is released in the occurence - // of an exception - GetData data (*pData); - delete pData; - Action * action; - - action = new GetAction (this, data); - Perform (action); - } + if (pData != 0) + { + // copy the data first. This makes sure + // the memory is released in the occurence + // of an exception + GetData data(*pData); + delete pData; + Action * action; + + action = new GetAction(this, data); + Perform(action); } - break; + } + break; case TOKEN_DIFF: - { - DiffData * pData = static_cast(event.GetClientData ()); + { + DiffData * pData = static_cast(event.GetClientData()); - if (pData != 0) - { - // copy and delete data - DiffData data (*pData); - delete pData; - Action * action; + if (pData != 0) + { + // copy and delete data + DiffData data(*pData); + delete pData; + Action * action; - action = new DiffAction (this, data); - Perform (action); - } + action = new DiffAction(this, data); + Perform(action); } - break; + } + break; case TOKEN_MERGE: - { - MergeData * pData = static_cast(event.GetClientData ()); + { + MergeData * pData = static_cast(event.GetClientData()); - if (pData != 0) - { - // copy and delete data - MergeData data (*pData); - delete pData; - Action * action; + if (pData != 0) + { + // copy and delete data + MergeData data(*pData); + delete pData; + Action * action; - action = new MergeAction (this, data); - Perform (action); - } + action = new MergeAction(this, data); + Perform(action); } - break; + } + break; case TOKEN_DELETE_ACTION: - { - Action * action = static_cast(event.GetClientData ()); + { + Action * action = static_cast(event.GetClientData()); - if (action != 0) - delete action; - } - break; + if (action != 0) + delete action; + } + break; case TOKEN_UPDATE_ASCENDING: - UpdateMenuAscending (); + UpdateMenuAscending(); break; case TOKEN_UPDATE_SORTING: - UpdateMenuSorting (); + UpdateMenuSorting(); break; case TOKEN_ANNOTATE: - { - AnnotateData * pData = static_cast(event.GetClientData ()); + { + AnnotateData * pData = static_cast(event.GetClientData()); - if (pData != 0) - { - // copy and delete data - AnnotateData data (*pData); - delete pData; - Action * action; + if (pData != 0) + { + // copy and delete data + AnnotateData data(*pData); + delete pData; + Action * action; - action = new AnnotateAction (this, data); - Perform (action); - } + action = new AnnotateAction(this, data); + Perform(action); } - break; + } + break; case TOKEN_LOG: - { - LogData * pData = static_cast(event.GetClientData ()); + { + LogData * pData = static_cast(event.GetClientData()); - if (pData != 0) - { - LogDlg dlg (this, pData->target.c_str (), pData->logEntries); - dlg.ShowModal (); + if (pData != 0) + { + LogDlg dlg(this, pData->target.c_str(), pData->logEntries); + dlg.ShowModal(); - delete pData->logEntries; - delete pData; - } + delete pData->logEntries; + delete pData; } - break; + } + break; case TOKEN_DRAG_N_DROP: + { + DragAndDropData * pData = static_cast(event.GetClientData()); + if (pData != 0) { - DragAndDropData * pData = static_cast(event.GetClientData ()); - if (pData != 0) - { - // copy and delete data - DragAndDropData data (*pData); - delete pData; - Action * action; + // copy and delete data + DragAndDropData data(*pData); + delete pData; + Action * action; - action = new DragAndDropAction (this, data); - Perform (action); - } + action = new DragAndDropAction(this, data); + Perform(action); } - break; + } + break; } } void -RapidSvnFrame::OnToolEnter (wxCommandEvent & event) +RapidSvnFrame::OnToolEnter(wxCommandEvent & event) { } void -RapidSvnFrame::OnFolderBrowserSelChanged (wxTreeEvent & event) +RapidSvnFrame::OnFolderBrowserSelChanged(wxTreeEvent & event) { - if (m->IsRunning ()) + if (m->IsRunning()) return; try { m->activePane = ACTIVEPANE_FOLDER_BROWSER; - // Update the menu and list control flat-mode setting - bool flatMode = m->folderBrowser->IsFlat (); - m->listCtrl->SetFlat (flatMode); - m->CheckMenu (ID_Flat, flatMode); + // Update the menu and list control flat-mode setting + bool flatMode = m->folderBrowser->IsFlat(); + m->listCtrl->SetFlat(flatMode); + m->CheckMenu(ID_Flat, flatMode); + + SetIncludePathVisibility(flatMode); - SetIncludePathVisibility (flatMode); - // Disable menu entry if no path is selected (e.g. root) - const wxString & path = m->folderBrowser->GetPath (); - m->MenuBar->Enable (ID_Flat, !path.IsEmpty ()); + const wxString & path = m->folderBrowser->GetPath(); + m->MenuBar->Enable(ID_Flat, !path.IsEmpty()); - UpdateCurrentPath (); - RefreshFileList (); + UpdateCurrentPath(); + RefreshFileList(); } - catch(...) + catch (...) { - m->Trace (_("Exception occured during filelist update")); + m->Trace(_("Exception occured during filelist update")); } } void -RapidSvnFrame::OnFolderBrowserKeyDown (wxTreeEvent & event) +RapidSvnFrame::OnFolderBrowserKeyDown(wxTreeEvent & event) { - switch (event.GetKeyEvent ().GetKeyCode ()) + switch (event.GetKeyEvent().GetKeyCode()) { case WXK_RETURN: - ProcessCommand (ID_Default_Action); + ProcessCommand(ID_Default_Action); break; default: - event.Skip (); + event.Skip(); break; } } void -RapidSvnFrame::OnFileListSelected (wxListEvent & event) +RapidSvnFrame::OnFileListSelected(wxListEvent & event) { m->activePane = ACTIVEPANE_FILELIST; } void -RapidSvnFrame::OnListenerEvent (wxCommandEvent & event) +RapidSvnFrame::OnListenerEvent(wxCommandEvent & event) { - m->listener.handleEvent (event); + m->listener.handleEvent(event); } /*** END OF SECTION EVENTS ***/ void -RapidSvnFrame::AddWcBookmark () +RapidSvnFrame::AddWcBookmark() { - wxDirDialog dialog (this, _("Select a directory"), wxGetHomeDir ()); + wxDirDialog dialog(this, _("Select a directory"), wxGetHomeDir()); bool add = TRUE; // select dir dialog - if (dialog.ShowModal () != wxID_OK) + if (dialog.ShowModal() != wxID_OK) { return; } @@ -2048,77 +2048,77 @@ RapidSvnFrame::AddWcBookmark () // admin dir? // TODO: Should we have a translated-once constant // rather than keep converting SVN_WC_ADM_DIR_NAME? - wxFileName fileName (dialog.GetPath ()); - if ((fileName.GetName () + fileName.GetExt ()) == - Utf8ToLocal (SVN_WC_ADM_DIR_NAME)) + wxFileName fileName(dialog.GetPath()); + if ((fileName.GetName() + fileName.GetExt()) == + Utf8ToLocal(SVN_WC_ADM_DIR_NAME)) { add = FALSE; - wxMessageBox ( -_("You cannot add a subversion administrative \ + wxMessageBox( + _("You cannot add a subversion administrative \ directory to the bookmarks!"), - _("Error"), wxOK); + _("Error"), wxOK); return; } // add - m->folderBrowser->AddBookmark (dialog.GetPath ()); + m->folderBrowser->AddBookmark(dialog.GetPath()); m->skipFilelistUpdate = true; - RefreshFolderBrowser (); + RefreshFolderBrowser(); - wxLogStatus (_("Added working copy to bookmarks '%s'"), - dialog.GetPath ().c_str ()); + wxLogStatus(_("Added working copy to bookmarks '%s'"), + dialog.GetPath().c_str()); - m->folderBrowser->SelectBookmark (dialog.GetPath ()); + m->folderBrowser->SelectBookmark(dialog.GetPath()); //UpdateCurrentPath (); //RefreshFileList (); } void -RapidSvnFrame::AddRepoBookmark () +RapidSvnFrame::AddRepoBookmark() { const int flags = UpdateDlg::WITH_URL | UpdateDlg::WITHOUT_RECURSIVE | UpdateDlg::WITHOUT_REVISION; - UpdateDlg dialog (this, _("Repository URL"), flags); + UpdateDlg dialog(this, _("Repository URL"), flags); - if (dialog.ShowModal () != wxID_OK) + if (dialog.ShowModal() != wxID_OK) { return; } // add - wxString url = dialog.GetData ().url; - m->folderBrowser->AddBookmark (url); + wxString url = dialog.GetData().url; + m->folderBrowser->AddBookmark(url); m->skipFilelistUpdate = true; - RefreshFolderBrowser (); + RefreshFolderBrowser(); - wxLogStatus (_("Added repository to bookmarks '%s'"), - url.c_str ()); + wxLogStatus(_("Added repository to bookmarks '%s'"), + url.c_str()); - m->folderBrowser->SelectBookmark (url); + m->folderBrowser->SelectBookmark(url); //UpdateCurrentPath (); //RefreshFileList (); } inline void -RapidSvnFrame::RemoveBookmark () +RapidSvnFrame::RemoveBookmark() { - wxASSERT (m->folderBrowser); - if( m->folderBrowser->RemoveBookmark() ) + wxASSERT(m->folderBrowser); + if (m->folderBrowser->RemoveBookmark()) { - wxLogStatus (_("Removed bookmark")); + wxLogStatus(_("Removed bookmark")); } } void -RapidSvnFrame::EditBookmark () +RapidSvnFrame::EditBookmark() { - wxASSERT (m->folderBrowser); + wxASSERT(m->folderBrowser); - const FolderItemData * bookmark = m->folderBrowser->GetSelectedItemData (); + const FolderItemData * bookmark = m->folderBrowser->GetSelectedItemData(); // if nothing is selected, or the wrong type, // just exit (this should be handled by the routine @@ -2127,60 +2127,60 @@ RapidSvnFrame::EditBookmark () if (!m->folderBrowser) return; - if (bookmark->getFolderType () != FOLDER_TYPE_BOOKMARK) + if (bookmark->getFolderType() != FOLDER_TYPE_BOOKMARK) return; // now edit the data - wxString oldPath (bookmark->getPath ()); - DestinationDlg dlg (this, _("Edit Bookmark"), _("Bookmark"), - 0, oldPath); + wxString oldPath(bookmark->getPath()); + DestinationDlg dlg(this, _("Edit Bookmark"), _("Bookmark"), + 0, oldPath); - if (dlg.ShowModal () == wxID_OK) + if (dlg.ShowModal() == wxID_OK) { // and if everything goes right, remove the old // selection and add the new one - wxString newPath (dlg.GetDestination ()); + wxString newPath(dlg.GetDestination()); // if nothing has changed, just exit if (oldPath == newPath) return; - m->folderBrowser->RemoveBookmark (); - m->folderBrowser->AddBookmark (newPath); - RefreshFolderBrowser (); - m->folderBrowser->SelectBookmark (newPath); + m->folderBrowser->RemoveBookmark(); + m->folderBrowser->AddBookmark(newPath); + RefreshFolderBrowser(); + m->folderBrowser->SelectBookmark(newPath); } } void -RapidSvnFrame::ShowInfo () +RapidSvnFrame::ShowInfo() { bool withUpdate = false; if (m->listCtrl) - withUpdate = m->listCtrl->GetWithUpdate (); + withUpdate = m->listCtrl->GetWithUpdate(); - FileInfo fileInfo (m_context, withUpdate); + FileInfo fileInfo(m_context, withUpdate); try { - std::vector vector = m->GetStatusSel ().targets (); + std::vector vector = m->GetStatusSel().targets(); std::vector::const_iterator it; - for (it = vector.begin (); it != vector.end (); it++) + for (it = vector.begin(); it != vector.end(); it++) { svn::Path path = *it; - fileInfo.addPath (path.c_str ()); + fileInfo.addPath(path.c_str()); } - wxString info = fileInfo.info (); + wxString info = fileInfo.info(); - ReportDlg dlg (this, _("Info"), info, NORMAL_REPORT); - dlg.ShowModal (); + ReportDlg dlg(this, _("Info"), info, NORMAL_REPORT); + dlg.ShowModal(); } catch (svn::ClientException & e) { - m->Trace (Utf8ToLocal (e.message ())); + m->Trace(Utf8ToLocal(e.message())); return; } @@ -2188,83 +2188,83 @@ RapidSvnFrame::ShowInfo () void -RapidSvnFrame::ShowPreferences () +RapidSvnFrame::ShowPreferences() { Preferences prefs; - PreferencesDlg dlg (this, & prefs); - bool ok = dlg.ShowModal () == wxID_OK; + PreferencesDlg dlg(this, & prefs); + bool ok = dlg.ShowModal() == wxID_OK; if (ok) { - m->folderBrowser->SetAuthCache (prefs.useAuthCache); - m->folderBrowser->SetAuthPerBookmark (prefs.authPerBookmark); + m->folderBrowser->SetAuthCache(prefs.useAuthCache); + m->folderBrowser->SetAuthPerBookmark(prefs.authPerBookmark); } } void -RapidSvnFrame::UpdateCurrentPath () +RapidSvnFrame::UpdateCurrentPath() { if (m->folderBrowser == 0) { - m->currentPath.Clear (); + m->currentPath.Clear(); m_context = 0; } else { - m->currentPath = m->folderBrowser->GetPath (); - m_context = m->folderBrowser->GetContext (); + m->currentPath = m->folderBrowser->GetPath(); + m_context = m->folderBrowser->GetContext(); } - if (m->currentPath.Length () > 0) - SetTitle (m_title + wxT(" - ") + m->currentPath); + if (m->currentPath.Length() > 0) + SetTitle(m_title + wxT(" - ") + m->currentPath); else - SetTitle (m_title); + SetTitle(m_title); } bool -RapidSvnFrame::InvokeDefaultAction () +RapidSvnFrame::InvokeDefaultAction() { - const svn::StatusSel & statusSel = m->GetStatusSel (); + const svn::StatusSel & statusSel = m->GetStatusSel(); // the default action will be invoked only for a single file // or folder. // if more or less than one file or folder is selected nothing // will happen. - if (1 != statusSel.size ()) + if (1 != statusSel.size()) return false; - if (statusSel.hasDirs ()) + if (statusSel.hasDirs()) { // go one folder deeper... - m->folderBrowser->SelectFolder ( - FullNativePath (statusSel.target (), m->currentPath, m->listCtrl->IsFlat ()) + m->folderBrowser->SelectFolder( + FullNativePath(statusSel.target(), m->currentPath, m->listCtrl->IsFlat()) ); } else { - Perform (new ExternalProgramAction (this, -1, false)); + Perform(new ExternalProgramAction(this, -1, false)); } return true; } void -RapidSvnFrame::Perform (Action * action) +RapidSvnFrame::Perform(Action * action) { try { - m->listener.cancel (false); + m->listener.cancel(false); - svn::Path currentPathUtf8 (PathUtf8 (m->currentPath)); - action->SetPath (currentPathUtf8); - action->SetContext (m_context); - action->SetStatusSel (m->GetStatusSel ()); - action->SetTracer (m->logTracer, false); - m_actionWorker->SetTracer (m->logTracer); - m_actionWorker->SetContext (m_context, false); - if (m_actionWorker->Perform (action)) - m->SetRunning (true); + svn::Path currentPathUtf8(PathUtf8(m->currentPath)); + action->SetPath(currentPathUtf8); + action->SetContext(m_context); + action->SetStatusSel(m->GetStatusSel()); + action->SetTracer(m->logTracer, false); + m_actionWorker->SetTracer(m->logTracer); + m_actionWorker->SetContext(m_context, false); + if (m_actionWorker->Perform(action)) + m->SetRunning(true); } catch (...) { @@ -2273,71 +2273,71 @@ RapidSvnFrame::Perform (Action * action) } inline void -RapidSvnFrame::UpdateMenuSorting () +RapidSvnFrame::UpdateMenuSorting() { - m->CheckSort (m->listCtrl->GetSortColumn() + ID_ColumnSort_Min + 1); + m->CheckSort(m->listCtrl->GetSortColumn() + ID_ColumnSort_Min + 1); } inline void -RapidSvnFrame::UpdateMenuIncludePath () +RapidSvnFrame::UpdateMenuIncludePath() { - m->CheckMenu (ID_Include_Path, m->listCtrl->GetIncludePath()); + m->CheckMenu(ID_Include_Path, m->listCtrl->GetIncludePath()); } inline void -RapidSvnFrame::UpdateMenuAscending () +RapidSvnFrame::UpdateMenuAscending() { - m->CheckMenu (ID_Sort_Ascending, m->listCtrl->GetSortAscending()); + m->CheckMenu(ID_Sort_Ascending, m->listCtrl->GetSortAscending()); } void -RapidSvnFrame::SetIncludePathVisibility (bool flatMode) +RapidSvnFrame::SetIncludePathVisibility(bool flatMode) { if (flatMode == false) { - if (m->listCtrl->GetIncludePath () == true) - m->CheckMenu (ID_Include_Path, false); - - UpdateMenuSorting (); - UpdateMenuAscending (); + if (m->listCtrl->GetIncludePath() == true) + m->CheckMenu(ID_Include_Path, false); + + UpdateMenuSorting(); + UpdateMenuAscending(); } else { - UpdateMenuIncludePath (); + UpdateMenuIncludePath(); } - m->EnableMenuEntry (ID_Include_Path, flatMode); + m->EnableMenuEntry(ID_Include_Path, flatMode); } void -RapidSvnFrame::OnSize (wxSizeEvent & sizeEvent) +RapidSvnFrame::OnSize(wxSizeEvent & sizeEvent) { - if (!this->IsMaximized () && IsShown ()) + if (!this->IsMaximized() && IsShown()) { - m->vertSplitter->SetSashGravity (0.0f); - m->horizSplitter->SetSashGravity (1.0f); + m->vertSplitter->SetSashGravity(0.0f); + m->horizSplitter->SetSashGravity(1.0f); } - sizeEvent.Skip (); + sizeEvent.Skip(); } -void -RapidSvnFrame::OnFocusChanged (wxCommandEvent & event) +void +RapidSvnFrame::OnFocusChanged(wxCommandEvent & event) { - switch (event.GetId ()) + switch (event.GetId()) { case FOLDER_BROWSER: - SetActivePane (ACTIVEPANE_FOLDER_BROWSER); + SetActivePane(ACTIVEPANE_FOLDER_BROWSER); break; - + case FILELIST_CTRL: - SetActivePane (ACTIVEPANE_FILELIST); + SetActivePane(ACTIVEPANE_FILELIST); break; default: ; // unknown/not interesting } } - + /* ----------------------------------------------------------------- * local variables: diff --git a/src/rapidsvn_frame.hpp b/src/rapidsvn_frame.hpp index 1a2e360e..be28870a 100644 --- a/src/rapidsvn_frame.hpp +++ b/src/rapidsvn_frame.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -58,104 +58,104 @@ class RapidSvnFrame : public wxFrame * @param title Application title * @param locale The locale that's used by the app */ - RapidSvnFrame (const wxString & title, - const wxLocale & locale); - virtual ~RapidSvnFrame (); + RapidSvnFrame(const wxString & title, + const wxLocale & locale); + virtual ~RapidSvnFrame(); /** Allow children to trim their popup menus using the frames logic */ void - TrimDisabledMenuItems (wxMenu & menu); + TrimDisabledMenuItems(wxMenu & menu); /** * Change the active window, if the corresponding event is handled * in one of the sub-windows */ void - SetActivePane (ActivePane value); + SetActivePane(ActivePane value); private: /** disallow default constructor */ - RapidSvnFrame (); + RapidSvnFrame(); /** disallow copy constructor */ - RapidSvnFrame (const RapidSvnFrame &); + RapidSvnFrame(const RapidSvnFrame &); - void OnActivate (wxActivateEvent & event); - void OnFocusChanged (wxCommandEvent & event); + void OnActivate(wxActivateEvent & event); + void OnFocusChanged(wxCommandEvent & event); // File menu - void OnAddWcBookmark (wxCommandEvent & event); - void OnAddRepoBookmark (wxCommandEvent & event); - void OnRemoveBookmark (wxCommandEvent & event); - void OnEditBookmark (wxCommandEvent & event); - void OnQuit (wxCommandEvent & event); + void OnAddWcBookmark(wxCommandEvent & event); + void OnAddRepoBookmark(wxCommandEvent & event); + void OnRemoveBookmark(wxCommandEvent & event); + void OnEditBookmark(wxCommandEvent & event); + void OnQuit(wxCommandEvent & event); // View menu - void OnPreferences (wxCommandEvent & event); - void OnRefresh (wxCommandEvent & event); - void OnColumnReset (wxCommandEvent & event); - void OnColumn (wxCommandEvent & event); - void OnIncludePath (wxCommandEvent & event); - void OnSortAscending (wxCommandEvent & event); - void OnColumnSorting (wxCommandEvent & event); - void OnFlatView (wxCommandEvent & event); - void OnRefreshWithUpdate (wxCommandEvent & event); - void OnShowUnversioned (wxCommandEvent & event); - void OnShowUnmodified (wxCommandEvent & event); - void OnShowModified (wxCommandEvent & event); - void OnShowConflicted (wxCommandEvent & event); - void OnIgnoreExternals (wxCommandEvent & event); - void OnShowIgnored (wxCommandEvent & event); - void OnStop (wxCommandEvent & event); + void OnPreferences(wxCommandEvent & event); + void OnRefresh(wxCommandEvent & event); + void OnColumnReset(wxCommandEvent & event); + void OnColumn(wxCommandEvent & event); + void OnIncludePath(wxCommandEvent & event); + void OnSortAscending(wxCommandEvent & event); + void OnColumnSorting(wxCommandEvent & event); + void OnFlatView(wxCommandEvent & event); + void OnRefreshWithUpdate(wxCommandEvent & event); + void OnShowUnversioned(wxCommandEvent & event); + void OnShowUnmodified(wxCommandEvent & event); + void OnShowModified(wxCommandEvent & event); + void OnShowConflicted(wxCommandEvent & event); + void OnIgnoreExternals(wxCommandEvent & event); + void OnShowIgnored(wxCommandEvent & event); + void OnStop(wxCommandEvent & event); // Query menu - void OnLog (wxCommandEvent & event); - void OnInfo (wxCommandEvent & event); + void OnLog(wxCommandEvent & event); + void OnInfo(wxCommandEvent & event); // Modify menu - void OnFileCommand (wxCommandEvent & event); + void OnFileCommand(wxCommandEvent & event); // Extras menu - void OnCleanup (wxCommandEvent & event); + void OnCleanup(wxCommandEvent & event); // Help menu - void OnHelpContents (wxCommandEvent & event); - void OnHelpIndex (wxCommandEvent & event); - void OnHelpStartupTips (wxCommandEvent & event); - void OnAbout (wxCommandEvent & event); + void OnHelpContents(wxCommandEvent & event); + void OnHelpIndex(wxCommandEvent & event); + void OnHelpStartupTips(wxCommandEvent & event); + void OnAbout(wxCommandEvent & event); // Test menu - void OnTestNewWxString (wxCommandEvent & event); - void OnTestListener (wxCommandEvent & event); - void OnTestCheckout (wxCommandEvent & event); - void PrintTimeMeasurements (apr_time_t start, apr_time_t end, - const wxString & name); + void OnTestNewWxString(wxCommandEvent & event); + void OnTestListener(wxCommandEvent & event); + void OnTestCheckout(wxCommandEvent & event); + void PrintTimeMeasurements(apr_time_t start, apr_time_t end, + const wxString & name); // toolbar events - void OnToolEnter (wxCommandEvent & event); + void OnToolEnter(wxCommandEvent & event); // Events from action threads - void OnActionEvent (wxCommandEvent & event); - void OnListenerEvent (wxCommandEvent & event); + void OnActionEvent(wxCommandEvent & event); + void OnListenerEvent(wxCommandEvent & event); - // Bookmarks - void AddWcBookmark (); - void AddRepoBookmark (); - void RemoveBookmark (); - void EditBookmark (); + // Bookmarks + void AddWcBookmark(); + void AddRepoBookmark(); + void RemoveBookmark(); + void EditBookmark(); - // Authentication - void OnLogin (wxCommandEvent & event); - void OnLogout (wxCommandEvent & event); + // Authentication + void OnLogin(wxCommandEvent & event); + void OnLogout(wxCommandEvent & event); // Folder Browser event handlers - void OnFolderBrowserSelChanged (wxTreeEvent & event); - void OnFolderBrowserKeyDown (wxTreeEvent & event); + void OnFolderBrowserSelChanged(wxTreeEvent & event); + void OnFolderBrowserKeyDown(wxTreeEvent & event); // File List event handles - void OnFileListSelected (wxListEvent & event); + void OnFileListSelected(wxListEvent & event); + - /** * Invoke the default action on the currently selected item(s) @@ -165,45 +165,45 @@ class RapidSvnFrame : public wxFrame * * @return false if no items were found to invoke default action on */ - bool InvokeDefaultAction (); + bool InvokeDefaultAction(); - /** - * Update the contents of the filelist + /** + * Update the contents of the filelist */ - void RefreshFileList (); + void RefreshFileList(); - /** - * Update the contents of the folder browser + /** + * Update the contents of the folder browser */ - void RefreshFolderBrowser (); + void RefreshFolderBrowser(); // Auxiliary functions - void UpdateCurrentPath (); - void UpdateMenuSorting (); - void UpdateMenuIncludePath (); - void UpdateMenuAscending (); - void SetIncludePathVisibility (bool flatMode); - void OnSize (wxSizeEvent & sizeEvent); + void UpdateCurrentPath(); + void UpdateMenuSorting(); + void UpdateMenuIncludePath(); + void UpdateMenuAscending(); + void SetIncludePathVisibility(bool flatMode); + void OnSize(wxSizeEvent & sizeEvent); // Enable/disable action menu items - void OnUpdateCommand (wxUpdateUIEvent & updateUIEvent); + void OnUpdateCommand(wxUpdateUIEvent & updateUIEvent); // Utility functions - void ShowLog (); - void ShowInfo (); + void ShowLog(); + void ShowInfo(); - void DelEntries (); - void MakeRevert (); - void MakeResolve (); + void DelEntries(); + void MakeRevert(); + void MakeResolve(); - void MakeCopy (); - void Rename (); - void Mkdir (); - void Merge (); - void Contents (); - void ShowPreferences (); + void MakeCopy(); + void Rename(); + void Mkdir(); + void Merge(); + void Contents(); + void ShowPreferences(); - void Perform (Action * action); + void Perform(Action * action); private: /** hide implementation data */ @@ -220,7 +220,7 @@ class RapidSvnFrame : public wxFrame svn::Context * m_context; private: - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; const int ID_TOOLBAR = 500; diff --git a/src/rename_action.cpp b/src/rename_action.cpp index a756efa1..a6e82746 100644 --- a/src/rename_action.cpp +++ b/src/rename_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -33,62 +33,62 @@ #include "destination_dlg.hpp" #include "utils.hpp" -RenameAction::RenameAction (wxWindow * parent) - : Action (parent, wxEmptyString, UPDATE_TREE) +RenameAction::RenameAction(wxWindow * parent) + : Action(parent, wxEmptyString, UPDATE_TREE) { - SetName (_("Rename")); + SetName(_("Rename")); } bool -RenameAction::Prepare () +RenameAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - wxString oldName (Utf8ToLocal (GetTarget ().basename ().c_str ())); + wxString oldName(Utf8ToLocal(GetTarget().basename().c_str())); // show destination dialog - DestinationDlg dlg (GetParent (), GetName (), - _("Enter new name:"), - DestinationDlg::WITH_FORCE, - oldName); - if (dlg.ShowModal () != wxID_OK) + DestinationDlg dlg(GetParent(), GetName(), + _("Enter new name:"), + DestinationDlg::WITH_FORCE, + oldName); + if (dlg.ShowModal() != wxID_OK) { return false; } - m_destination = dlg.GetDestination (); - m_force = dlg.GetForce (); + m_destination = dlg.GetDestination(); + m_force = dlg.GetForce(); return true; } bool -RenameAction::Perform () +RenameAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); - svn::Path srcPath = GetTarget (); - svn::Path destPath (PathUtf8 (m_destination)); + svn::Path srcPath = GetTarget(); + svn::Path destPath(PathUtf8(m_destination)); svn::Revision unusedRevision; std::string basename; std::string dirpath; - srcPath.split (dirpath, basename); + srcPath.split(dirpath, basename); - svn::Path newDestPath (dirpath); - newDestPath.addComponent(destPath.c_str ()); + svn::Path newDestPath(dirpath); + newDestPath.addComponent(destPath.c_str()); - client.move (srcPath, unusedRevision, newDestPath, m_force); + client.move(srcPath, unusedRevision, newDestPath, m_force); return true; } bool -RenameAction::CheckStatusSel (const svn::StatusSel & statusSel) +RenameAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/rename_action.hpp b/src/rename_action.hpp index 3540fa53..6e294716 100644 --- a/src/rename_action.hpp +++ b/src/rename_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -52,16 +52,16 @@ class RenameAction:public Action * * @param parent parent window */ - RenameAction (wxWindow * parent); + RenameAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); + + virtual bool + Prepare(); - virtual bool - Prepare (); - static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); }; #endif diff --git a/src/report_dlg.cpp b/src/report_dlg.cpp index ef71951f..0af2e693 100644 --- a/src/report_dlg.cpp +++ b/src/report_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -31,59 +31,59 @@ // app #include "report_dlg.hpp" -BEGIN_EVENT_TABLE (ReportDlg, wxDialog) -EVT_BUTTON (-1, ReportDlg::OnButton) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(ReportDlg, wxDialog) + EVT_BUTTON(-1, ReportDlg::OnButton) +END_EVENT_TABLE() -ReportDlg::ReportDlg (wxWindow * parent, - const wxString & caption, - const wxString & data, int type) - : wxDialog (parent, -1, caption, wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), - m_str (data) +ReportDlg::ReportDlg(wxWindow * parent, + const wxString & caption, + const wxString & data, int type) + : wxDialog(parent, -1, caption, wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), + m_str(data) { - m_text = new wxTextCtrl (this, -1, wxEmptyString, - wxDefaultPosition, - wxSize (500, 200), - wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH); - m_text->SetMaxLength (0); + m_text = new wxTextCtrl(this, -1, wxEmptyString, + wxDefaultPosition, + wxSize(500, 200), + wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH); + m_text->SetMaxLength(0); if (type == ERROR_REPORT) { - m_text->SetDefaultStyle (wxTextAttr (*wxRED)); + m_text->SetDefaultStyle(wxTextAttr(*wxRED)); } - m_text->WriteText (m_str); + m_text->WriteText(m_str); - m_button = new wxButton (this, wxID_OK, _("OK")); + m_button = new wxButton(this, wxID_OK, _("OK")); - wxBoxSizer * topsizer = new wxBoxSizer (wxVERTICAL); + wxBoxSizer * topsizer = new wxBoxSizer(wxVERTICAL); - topsizer->Add (m_text, 1, // make vertically stretchable - wxEXPAND | // make horizontally stretchable - wxALL, // and make border all around - 5); // set border width to 10 + topsizer->Add(m_text, 1, // make vertically stretchable + wxEXPAND | // make horizontally stretchable + wxALL, // and make border all around + 5); // set border width to 10 - wxBoxSizer * button_sizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer * button_sizer = new wxBoxSizer(wxHORIZONTAL); - button_sizer->Add (m_button, 0, // make horizontally unstretchable - wxALL, // make border all around (implicit top alignment) - 5); // set border width to 10 + button_sizer->Add(m_button, 0, // make horizontally unstretchable + wxALL, // make border all around (implicit top alignment) + 5); // set border width to 10 - topsizer->Add (button_sizer, 0, // make vertically unstretchable - wxALIGN_CENTER); // no border and centre horizontally + topsizer->Add(button_sizer, 0, // make vertically unstretchable + wxALIGN_CENTER); // no border and centre horizontally - SetAutoLayout (TRUE); // tell dialog to use sizer - SetSizer (topsizer); // actually set the sizer + SetAutoLayout(TRUE); // tell dialog to use sizer + SetSizer(topsizer); // actually set the sizer - topsizer->Fit (this); // set size to minimum size as calculated by the sizer - topsizer->SetSizeHints (this); // set size hints to honour mininum size + topsizer->Fit(this); // set size to minimum size as calculated by the sizer + topsizer->SetSizeHints(this); // set size hints to honour mininum size } void -ReportDlg::OnButton (wxCommandEvent & event) +ReportDlg::OnButton(wxCommandEvent & event) { - event.Skip (); + event.Skip(); } /* ----------------------------------------------------------------- * local variables: diff --git a/src/report_dlg.hpp b/src/report_dlg.hpp index 1983d9eb..9ad6f559 100644 --- a/src/report_dlg.hpp +++ b/src/report_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -40,18 +40,18 @@ class wxTextCtrl; class ReportDlg:public wxDialog { public: - ReportDlg (wxWindow * parent, - const wxString & caption, - const wxString & data, int type = NORMAL_REPORT); + ReportDlg(wxWindow * parent, + const wxString & caption, + const wxString & data, int type = NORMAL_REPORT); - void OnButton (wxCommandEvent & event); + void OnButton(wxCommandEvent & event); private: wxButton *m_button; wxTextCtrl *m_text; const wxString & m_str; - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/resolve_action.cpp b/src/resolve_action.cpp index 1b36f2ad..7df22f3c 100644 --- a/src/resolve_action.cpp +++ b/src/resolve_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -33,49 +33,49 @@ // app #include "resolve_action.hpp" -ResolveAction::ResolveAction (wxWindow * parent) - : Action (parent, _("Resolve")) +ResolveAction::ResolveAction(wxWindow * parent) + : Action(parent, _("Resolve")) { } bool -ResolveAction::Prepare () +ResolveAction::Prepare() { // No dialog for Resolve. - return Action::Prepare (); + return Action::Prepare(); } bool -ResolveAction::Perform () +ResolveAction::Perform() { - const std::vector v = GetTargets (); + const std::vector v = GetTargets(); std::vector::const_iterator it; - svn::Client client (GetContext ()); - for (it = v.begin (); it != v.end (); it++) + svn::Client client(GetContext()); + for (it = v.begin(); it != v.end(); it++) { const svn::Path & path = *it; - client.resolved (path.c_str (), false); + client.resolved(path.c_str(), false); } return true; } bool -ResolveAction::CheckStatusSel (const svn::StatusSel & statusSel) +ResolveAction::CheckStatusSel(const svn::StatusSel & statusSel) { // allow only local+versioned files - if (!statusSel.hasVersioned ()) + if (!statusSel.hasVersioned()) return false; - if (statusSel.hasUnversioned ()) + if (statusSel.hasUnversioned()) return false; - if (!statusSel.hasLocal ()) + if (!statusSel.hasLocal()) return false; - if (!statusSel.hasFiles ()) + if (!statusSel.hasFiles()) return false; return true; diff --git a/src/resolve_action.hpp b/src/resolve_action.hpp index 0faab456..a25de0d8 100644 --- a/src/resolve_action.hpp +++ b/src/resolve_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,16 +36,16 @@ namespace svn class ResolveAction:public Action { public: - ResolveAction (wxWindow * parent); + ResolveAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); }; #endif diff --git a/src/resource.hpp b/src/resource.hpp index 9bbc3f0f..5e2ce200 100644 --- a/src/resource.hpp +++ b/src/resource.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -29,7 +29,7 @@ #define MINIMAL_ABOUT 102 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 diff --git a/src/revert_action.cpp b/src/revert_action.cpp index 61214b63..a3ed62b1 100644 --- a/src/revert_action.cpp +++ b/src/revert_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -30,38 +30,38 @@ // app #include "revert_action.hpp" -RevertAction::RevertAction (wxWindow * parent) - : Action (parent, _("Revert")) +RevertAction::RevertAction(wxWindow * parent) + : Action(parent, _("Revert")) { } bool -RevertAction::Prepare () +RevertAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) return false; - wxMessageDialog dlg (GetParent (), - _("Do you want to revert local changes?"), - _("Revert"), wxYES_NO | wxICON_QUESTION); + wxMessageDialog dlg(GetParent(), + _("Do you want to revert local changes?"), + _("Revert"), wxYES_NO | wxICON_QUESTION); - if (dlg.ShowModal () != wxID_YES) + if (dlg.ShowModal() != wxID_YES) return false; return true; } bool -RevertAction::Perform () +RevertAction::Perform() { - svn::Client client (GetContext ()); - client.revert (GetTargets (), false); + svn::Client client(GetContext()); + client.revert(GetTargets(), false); return true; } bool -RevertAction::CheckStatusSel (const svn::StatusSel & statusSel) +RevertAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/revert_action.hpp b/src/revert_action.hpp index 80b4789f..b103ac98 100644 --- a/src/revert_action.hpp +++ b/src/revert_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,16 +36,16 @@ namespace svn class RevertAction:public Action { public: - RevertAction (wxWindow * parent); + RevertAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); }; #endif diff --git a/src/simple_worker.cpp b/src/simple_worker.cpp index 87ca1f27..6e483eeb 100644 --- a/src/simple_worker.cpp +++ b/src/simple_worker.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -51,24 +51,24 @@ struct SimpleWorker::Data /** * constructor */ - Data (wxWindow * parent) + Data(wxWindow * parent) { - Init (parent); + Init(parent); } /** * destructor */ - virtual ~Data () + virtual ~Data() { - SetContext (0, false); + SetContext(0, false); } /** * initialize values */ void - Init (wxWindow * parent) + Init(wxWindow * parent) { this->parent = parent; context = 0; @@ -87,7 +87,7 @@ struct SimpleWorker::Data * @param own own new context */ void - SetContext (svn::Context * ctx, bool own) + SetContext(svn::Context * ctx, bool own) { if (own && (ownContext != 0)) { @@ -100,45 +100,45 @@ struct SimpleWorker::Data } }; -SimpleWorker::SimpleWorker (wxWindow * parent) +SimpleWorker::SimpleWorker(wxWindow * parent) { - m = new Data (parent); + m = new Data(parent); } -SimpleWorker::~SimpleWorker () +SimpleWorker::~SimpleWorker() { delete m; } void -SimpleWorker::Create (wxWindow * parent) +SimpleWorker::Create(wxWindow * parent) { - m->Init (parent); + m->Init(parent); } ActionState -SimpleWorker::GetState () +SimpleWorker::GetState() { return m->state; } ActionResult -SimpleWorker::GetResult () +SimpleWorker::GetResult() { return m->result; } bool -SimpleWorker::Perform (Action * action) +SimpleWorker::Perform(Action * action) { // is there a context? we need one if (m->context == 0) { - SetContext (new svn::Context (), true); + SetContext(new svn::Context(), true); } - action->SetContext (m->context); - m->context->reset (); + action->SetContext(m->context); + m->context->reset(); m->result = ACTION_NOTHING; m->action = action; @@ -146,7 +146,7 @@ SimpleWorker::Perform (Action * action) try { - if (!m->action->Prepare ()) + if (!m->action->Prepare()) { m->result = ACTION_ABORTED; delete m->action; @@ -157,25 +157,25 @@ SimpleWorker::Perform (Action * action) } catch (svn::ClientException & e) { - wxString msg, errtxt (Utf8ToLocal (e.message ())); - msg.Printf ( _("Error while preparing action: %s"), errtxt.c_str () ); - TraceError (msg); + wxString msg, errtxt(Utf8ToLocal(e.message())); + msg.Printf(_("Error while preparing action: %s"), errtxt.c_str()); + TraceError(msg); return false; } catch (...) { - TraceError (_("Error while preparing action.")); + TraceError(_("Error while preparing action.")); return false; } - ActionEvent event (m->parent, TOKEN_ACTION_START); + ActionEvent event(m->parent, TOKEN_ACTION_START); { wxString msg; - msg.Printf (_("Execute: %s"), action->GetName ().c_str ()); + msg.Printf(_("Execute: %s"), action->GetName().c_str()); - event.init (m->parent, TOKEN_ACTION_START, msg); - event.Post (); + event.init(m->parent, TOKEN_ACTION_START, msg); + event.Post(); } unsigned int actionFlags = 0; @@ -185,7 +185,7 @@ SimpleWorker::Perform (Action * action) // this cursor stuff has to change... wxBusyCursor wait; m->state = ACTION_RUNNING; - bool result = m->action->Perform (); + bool result = m->action->Perform(); if (!result) { m->result = ACTION_ERROR; @@ -194,7 +194,7 @@ SimpleWorker::Perform (Action * action) { m->result = ACTION_SUCCESS; } - actionFlags = m->action->GetFlags (); + actionFlags = m->action->GetFlags(); delete m->action; m->action = 0; @@ -202,54 +202,54 @@ SimpleWorker::Perform (Action * action) } catch (svn::ClientException & e) { - wxString msg, errtxt (Utf8ToLocal (e.message ())); - msg.Printf (_("Error while performing action: %s"), - errtxt.c_str ()); + wxString msg, errtxt(Utf8ToLocal(e.message())); + msg.Printf(_("Error while performing action: %s"), + errtxt.c_str()); - event.init (m->parent, TOKEN_SVN_INTERNAL_ERROR, msg); - event.Post (); + event.init(m->parent, TOKEN_SVN_INTERNAL_ERROR, msg); + event.Post(); return false; } catch (...) { - wxString msg (_("Error while performing action.")); + wxString msg(_("Error while performing action.")); - event.init (m->parent, TOKEN_SVN_INTERNAL_ERROR, msg); - event.Post (); + event.init(m->parent, TOKEN_SVN_INTERNAL_ERROR, msg); + event.Post(); return false; } - event.init (m->parent, TOKEN_ACTION_END, (void*) new unsigned int(actionFlags)); - event.Post (); + event.init(m->parent, TOKEN_ACTION_END, (void*) new unsigned int(actionFlags)); + event.Post(); return true; } void -SimpleWorker::SetTracer (Tracer * tracer) +SimpleWorker::SetTracer(Tracer * tracer) { m->tracer = tracer; } void -SimpleWorker::TraceError (const wxString & message) +SimpleWorker::TraceError(const wxString & message) { if (m->tracer) { - m->tracer->TraceError (message); + m->tracer->TraceError(message); } } void -SimpleWorker::SetContext (svn::Context * context, bool own) +SimpleWorker::SetContext(svn::Context * context, bool own) { - m->SetContext (context, own); + m->SetContext(context, own); } svn::Context * -SimpleWorker::GetContext () const +SimpleWorker::GetContext() const { return m->context; } diff --git a/src/simple_worker.hpp b/src/simple_worker.hpp index 0a6b26d1..44dc3390 100644 --- a/src/simple_worker.hpp +++ b/src/simple_worker.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,53 +37,53 @@ class SimpleWorker : public ActionWorker /** * default constructor. */ - SimpleWorker (wxWindow * parent = 0); + SimpleWorker(wxWindow * parent = 0); /** * destructor */ - virtual ~SimpleWorker (); + virtual ~SimpleWorker(); /** * @see ActionWorker */ - virtual void - Create (wxWindow * parent); + virtual void + Create(wxWindow * parent); /** * @see ActionWorker */ - virtual ActionState - GetState (); + virtual ActionState + GetState(); /** * @see ActionWorker */ - virtual ActionResult - GetResult (); + virtual ActionResult + GetResult(); /** * @see ActionWorker */ - virtual void SetTracer (Tracer * tr); + virtual void SetTracer(Tracer * tr); /** * @see ActionWorker */ - virtual bool - Perform (Action * action); + virtual bool + Perform(Action * action); /** * @see ActionWorker */ virtual void - SetContext (svn::Context * context, bool own = false); + SetContext(svn::Context * context, bool own = false); /** * @see ActionWorker */ - virtual svn::Context * - GetContext () const; + virtual svn::Context * + GetContext() const; private: struct Data; @@ -92,7 +92,7 @@ class SimpleWorker : public ActionWorker /** * private copy constructor */ - SimpleWorker (const SimpleWorker &); + SimpleWorker(const SimpleWorker &); /** * sends a message to the tracer. This is @@ -101,7 +101,7 @@ class SimpleWorker : public ActionWorker * * @param message to send */ - void TraceError (const wxString & message); + void TraceError(const wxString & message); }; #endif diff --git a/src/svncpp/apr.cpp b/src/svncpp/apr.cpp index e8a1cb0c..8c5e27bd 100644 --- a/src/svncpp/apr.cpp +++ b/src/svncpp/apr.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,14 +34,14 @@ */ namespace svn { - Apr::Apr () + Apr::Apr() { - apr_initialize (); + apr_initialize(); } - Apr::~Apr () + Apr::~Apr() { - apr_terminate (); + apr_terminate(); } } diff --git a/src/svncpp/client.cpp b/src/svncpp/client.cpp index da72a04d..b84bc4d3 100644 --- a/src/svncpp/client.cpp +++ b/src/svncpp/client.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -31,29 +31,29 @@ namespace svn { - Client::Client (Context * context) + Client::Client(Context * context) { - setContext (context); + setContext(context); } - Client::~Client () + Client::~Client() { } const Context * - Client::getContext () const + Client::getContext() const { return m_context; } Context * - Client::getContext () + Client::getContext() { return m_context; } void - Client::setContext (Context * context) + Client::setContext(Context * context) { m_context = context; } diff --git a/src/svncpp/client_annotate.cpp b/src/svncpp/client_annotate.cpp index 9ea69251..14a7ee86 100644 --- a/src/svncpp/client_annotate.cpp +++ b/src/svncpp/client_annotate.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,45 +35,45 @@ namespace svn { static svn_error_t * - annotateReceiver (void *baton, - apr_int64_t line_no, - svn_revnum_t revision, - const char *author, - const char *date, - const char *line, - apr_pool_t *pool) + annotateReceiver(void *baton, + apr_int64_t line_no, + svn_revnum_t revision, + const char *author, + const char *date, + const char *line, + apr_pool_t *pool) { AnnotatedFile * entries = (AnnotatedFile *) baton; - entries->push_back ( - AnnotateLine (line_no, revision, - author?author:"unknown", - date?date:"unknown date", - line?line:"???")); + entries->push_back( + AnnotateLine(line_no, revision, + author?author:"unknown", + date?date:"unknown date", + line?line:"???")); return NULL; } AnnotatedFile * - Client::annotate (const Path & path, - const Revision & revisionStart, - const Revision & revisionEnd) throw (ClientException) + Client::annotate(const Path & path, + const Revision & revisionStart, + const Revision & revisionEnd) throw(ClientException) { Pool pool; AnnotatedFile * entries = new AnnotatedFile; svn_error_t *error; - error = svn_client_blame ( - path.c_str (), - revisionStart.revision (), - revisionEnd.revision (), - annotateReceiver, - entries, - *m_context, // client ctx - pool); + error = svn_client_blame( + path.c_str(), + revisionStart.revision(), + revisionEnd.revision(), + annotateReceiver, + entries, + *m_context, // client ctx + pool); if (error != NULL) { delete entries; - throw ClientException (error); + throw ClientException(error); } return entries; diff --git a/src/svncpp/client_cat.cpp b/src/svncpp/client_cat.cpp index 978068d3..32f807ea 100644 --- a/src/svncpp/client_cat.cpp +++ b/src/svncpp/client_cat.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -41,27 +41,27 @@ namespace svn { std::string - Client::cat (const Path & path, - const Revision & revision, - const Revision & peg_revision) throw (ClientException) + Client::cat(const Path & path, + const Revision & revision, + const Revision & peg_revision) throw(ClientException) { Pool pool; - - svn_stringbuf_t * stringbuf = svn_stringbuf_create ("", pool); - svn_stream_t * stream = svn_stream_from_stringbuf (stringbuf, pool); + + svn_stringbuf_t * stringbuf = svn_stringbuf_create("", pool); + svn_stream_t * stream = svn_stream_from_stringbuf(stringbuf, pool); svn_error_t * error; - error = svn_client_cat2 (stream, - path.c_str (), - peg_revision.revision (), - revision.revision (), - *m_context, - pool); + error = svn_client_cat2(stream, + path.c_str(), + peg_revision.revision(), + revision.revision(), + *m_context, + pool); if (error != 0) - throw ClientException (error); + throw ClientException(error); - return std::string (stringbuf->data, stringbuf->len); + return std::string(stringbuf->data, stringbuf->len); } /** @@ -80,53 +80,53 @@ namespace svn * @return open file */ static apr_file_t * - openTempFile (Path & dstPath, const Path & path, - const Revision & revision, Pool & pool) - throw (ClientException) + openTempFile(Path & dstPath, const Path & path, + const Revision & revision, Pool & pool) + throw(ClientException) { apr_file_t * file = 0; - if (dstPath.length () > 0) + if (dstPath.length() > 0) { apr_status_t status = - apr_file_open (&file, dstPath.c_str (), - APR_WRITE | APR_CREATE | - APR_TRUNCATE | APR_BINARY, - APR_OS_DEFAULT, - pool); + apr_file_open(&file, dstPath.c_str(), + APR_WRITE | APR_CREATE | + APR_TRUNCATE | APR_BINARY, + APR_OS_DEFAULT, + pool); if (status != 0) - throw ClientException (status); + throw ClientException(status); } else { // split the path into its components std::string dir, filename, ext; - path.split (dir, filename, ext); + path.split(dir, filename, ext); // add the revision number to the filename char revstring[20]; - if (revision.kind () == revision.HEAD) - strcpy (revstring, "HEAD"); + if (revision.kind() == revision.HEAD) + strcpy(revstring, "HEAD"); else - sprintf (revstring, "%" SVN_REVNUM_T_FMT, revision.revnum ()); + sprintf(revstring, "%" SVN_REVNUM_T_FMT, revision.revnum()); filename += "-"; filename += revstring; // replace the dir component with tempdir - Path tempPath = Path::getTempDir (); - tempPath.addComponent (filename); + Path tempPath = Path::getTempDir(); + tempPath.addComponent(filename); const char * unique_name; svn_error_t * error = - svn_io_open_unique_file ( - &file, &unique_name, - tempPath.c_str (), // path - ext.c_str (), // suffix + svn_io_open_unique_file( + &file, &unique_name, + tempPath.c_str(), // path + ext.c_str(), // suffix 0, // dont delete on close pool); if (error != 0) - throw ClientException (error); + throw ClientException(error); dstPath = unique_name; } @@ -135,39 +135,39 @@ namespace svn } void - Client::get (Path & dstPath, - const Path & path, - const Revision & revision, - const Revision & peg_revision) throw (ClientException) + Client::get(Path & dstPath, + const Path & path, + const Revision & revision, + const Revision & peg_revision) throw(ClientException) { Pool pool; // create a new file and suppose we only want // this users to be able to read and write the file - apr_file_t * file = openTempFile (dstPath, path, revision, pool); + apr_file_t * file = openTempFile(dstPath, path, revision, pool); - // now create a stream and let svn_client_cat write to the + // now create a stream and let svn_client_cat write to the // stream - svn_stream_t * stream = svn_stream_from_aprfile (file, pool); + svn_stream_t * stream = svn_stream_from_aprfile(file, pool); if (stream != 0) { - svn_error_t * error = svn_client_cat2 ( - stream, - path.c_str (), - peg_revision.revision() , - revision.revision (), - *m_context, - pool); + svn_error_t * error = svn_client_cat2( + stream, + path.c_str(), + peg_revision.revision() , + revision.revision(), + *m_context, + pool); if (error != 0) - throw ClientException (error); + throw ClientException(error); - svn_stream_close (stream); + svn_stream_close(stream); } // finalize stuff - apr_file_close (file); + apr_file_close(file); } } diff --git a/src/svncpp/client_diff.cpp b/src/svncpp/client_diff.cpp index ea8e1e3a..a3831629 100644 --- a/src/svncpp/client_diff.cpp +++ b/src/svncpp/client_diff.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -41,46 +41,46 @@ namespace svn * a quick way to create error messages */ static void - fail (apr_pool_t *pool, apr_status_t status, const char *fmt, ...) + fail(apr_pool_t *pool, apr_status_t status, const char *fmt, ...) { va_list ap; char *msg; svn_error_t * error; - va_start (ap, fmt); - msg = apr_pvsprintf (pool, fmt, ap); - va_end (ap); + va_start(ap, fmt); + msg = apr_pvsprintf(pool, fmt, ap); + va_end(ap); - error = svn_error_create (status, NULL, msg); - throw ClientException (error); + error = svn_error_create(status, NULL, msg); + throw ClientException(error); } /** * closes and deletes temporary files that diff has been using */ static void - diffCleanup (apr_file_t * outfile, const char * outfileName, - apr_file_t * errfile, const char * errfileName, - apr_pool_t *pool) + diffCleanup(apr_file_t * outfile, const char * outfileName, + apr_file_t * errfile, const char * errfileName, + apr_pool_t *pool) { if (outfile != NULL) - apr_file_close (outfile); + apr_file_close(outfile); if (errfile != NULL) - apr_file_close (errfile); + apr_file_close(errfile); if (outfileName != NULL) - svn_error_clear (svn_io_remove_file (outfileName, pool)); + svn_error_clear(svn_io_remove_file(outfileName, pool)); if (errfileName != NULL) - svn_error_clear (svn_io_remove_file (errfileName, pool)); + svn_error_clear(svn_io_remove_file(errfileName, pool)); } std::string - Client::diff (const Path & tmpPath, const Path & path, - const Revision & revision1, const Revision & revision2, - const bool recurse, const bool ignoreAncestry, - const bool noDiffDeleted) throw (ClientException) + Client::diff(const Path & tmpPath, const Path & path, + const Revision & revision1, const Revision & revision2, + const bool recurse, const bool ignoreAncestry, + const bool noDiffDeleted) throw(ClientException) { Pool pool; svn_error_t * error; @@ -93,79 +93,79 @@ namespace svn svn_stringbuf_t * stringbuf; // svn_client_diff needs an options array, even if it is empty - options = apr_array_make (pool, 0, 0); + options = apr_array_make(pool, 0, 0); // svn_client_diff needs a temporary file to write diff output to - error = svn_io_open_unique_file (&outfile, &outfileName, - tmpPath.c_str(), ".tmp", - FALSE, pool); + error = svn_io_open_unique_file(&outfile, &outfileName, + tmpPath.c_str(), ".tmp", + FALSE, pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } // and another one to write errors to - error = svn_io_open_unique_file (&errfile, &errfileName, - tmpPath.c_str(), ".tmp", - FALSE, pool); + error = svn_io_open_unique_file(&errfile, &errfileName, + tmpPath.c_str(), ".tmp", + FALSE, pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } // run diff - error = svn_client_diff (options, - path.c_str (), revision1.revision (), - path.c_str (), revision2.revision (), - recurse, ignoreAncestry, noDiffDeleted, - outfile, errfile, - *m_context, - pool); + error = svn_client_diff(options, + path.c_str(), revision1.revision(), + path.c_str(), revision2.revision(), + recurse, ignoreAncestry, noDiffDeleted, + outfile, errfile, + *m_context, + pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } // then we reopen outfile for reading - status = apr_file_close (outfile); + status = apr_file_close(outfile); if (status) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - fail (pool, status, "failed to close '%s'", outfileName); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + fail(pool, status, "failed to close '%s'", outfileName); } - status = apr_file_open (&outfile, outfileName, APR_READ, APR_OS_DEFAULT, pool); + status = apr_file_open(&outfile, outfileName, APR_READ, APR_OS_DEFAULT, pool); if (status) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - fail (pool, status, "failed to open '%s'", outfileName); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + fail(pool, status, "failed to open '%s'", outfileName); } // now we can read the diff output from outfile and return that - error = svn_stringbuf_from_aprfile (&stringbuf, outfile, pool); + error = svn_stringbuf_from_aprfile(&stringbuf, outfile, pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } - diffCleanup (outfile, outfileName, errfile, errfileName, pool); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); return stringbuf->data; } std::string - Client::diff (const Path & tmpPath, const Path & path1, - const Path & path2, const Revision & revision1, - const Revision & revision2, const bool recurse, - const bool ignoreAncestry, const bool noDiffDeleted) - throw (ClientException) + Client::diff(const Path & tmpPath, const Path & path1, + const Path & path2, const Revision & revision1, + const Revision & revision2, const bool recurse, + const bool ignoreAncestry, const bool noDiffDeleted) + throw(ClientException) { Pool pool; svn_error_t * error; @@ -178,79 +178,79 @@ namespace svn svn_stringbuf_t * stringbuf; // svn_client_diff needs an options array, even if it is empty - options = apr_array_make (pool, 0, 0); + options = apr_array_make(pool, 0, 0); // svn_client_diff needs a temporary file to write diff output to - error = svn_io_open_unique_file (&outfile, &outfileName, - tmpPath.c_str(), ".tmp", - FALSE, pool); + error = svn_io_open_unique_file(&outfile, &outfileName, + tmpPath.c_str(), ".tmp", + FALSE, pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } // and another one to write errors to - error = svn_io_open_unique_file (&errfile, &errfileName, - tmpPath.c_str(), ".tmp", - FALSE, pool); + error = svn_io_open_unique_file(&errfile, &errfileName, + tmpPath.c_str(), ".tmp", + FALSE, pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } // run diff - error = svn_client_diff (options, - path1.c_str (), revision1.revision (), - path2.c_str (), revision2.revision (), - recurse, ignoreAncestry, noDiffDeleted, - outfile, errfile, - *m_context, - pool); + error = svn_client_diff(options, + path1.c_str(), revision1.revision(), + path2.c_str(), revision2.revision(), + recurse, ignoreAncestry, noDiffDeleted, + outfile, errfile, + *m_context, + pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } // then we reopen outfile for reading - status = apr_file_close (outfile); + status = apr_file_close(outfile); if (status) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - fail (pool, status, "failed to close '%s'", outfileName); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + fail(pool, status, "failed to close '%s'", outfileName); } - status = apr_file_open (&outfile, outfileName, APR_READ, APR_OS_DEFAULT, pool); + status = apr_file_open(&outfile, outfileName, APR_READ, APR_OS_DEFAULT, pool); if (status) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - fail (pool, status, "failed to open '%s'", outfileName); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + fail(pool, status, "failed to open '%s'", outfileName); } // now we can read the diff output from outfile and return that - error = svn_stringbuf_from_aprfile (&stringbuf, outfile, pool); + error = svn_stringbuf_from_aprfile(&stringbuf, outfile, pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } - diffCleanup (outfile, outfileName, errfile, errfileName, pool); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); return stringbuf->data; } std::string - Client::diff (const Path & tmpPath, const Path & path, - const Revision & pegRevision, - const Revision & revision1, const Revision & revision2, - const bool recurse, const bool ignoreAncestry, - const bool noDiffDeleted) throw (ClientException) + Client::diff(const Path & tmpPath, const Path & path, + const Revision & pegRevision, + const Revision & revision1, const Revision & revision2, + const bool recurse, const bool ignoreAncestry, + const bool noDiffDeleted) throw(ClientException) { Pool pool; svn_error_t * error; @@ -263,70 +263,70 @@ namespace svn svn_stringbuf_t * stringbuf; // svn_client_diff needs an options array, even if it is empty - options = apr_array_make (pool, 0, 0); + options = apr_array_make(pool, 0, 0); // svn_client_diff needs a temporary file to write diff output to - error = svn_io_open_unique_file (&outfile, &outfileName, - tmpPath.c_str(), ".tmp", - FALSE, pool); + error = svn_io_open_unique_file(&outfile, &outfileName, + tmpPath.c_str(), ".tmp", + FALSE, pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } // and another one to write errors to - error = svn_io_open_unique_file (&errfile, &errfileName, - tmpPath.c_str(), ".tmp", - FALSE, pool); + error = svn_io_open_unique_file(&errfile, &errfileName, + tmpPath.c_str(), ".tmp", + FALSE, pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } // run diff - error = svn_client_diff_peg (options, - path.c_str (), pegRevision.revision(), - revision1.revision (), revision2.revision (), - recurse, ignoreAncestry, noDiffDeleted, - outfile, errfile, - *m_context, - pool); + error = svn_client_diff_peg(options, + path.c_str(), pegRevision.revision(), + revision1.revision(), revision2.revision(), + recurse, ignoreAncestry, noDiffDeleted, + outfile, errfile, + *m_context, + pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } // then we reopen outfile for reading - status = apr_file_close (outfile); + status = apr_file_close(outfile); if (status) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - fail (pool, status, "failed to close '%s'", outfileName); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + fail(pool, status, "failed to close '%s'", outfileName); } - status = apr_file_open (&outfile, outfileName, APR_READ, APR_OS_DEFAULT, pool); + status = apr_file_open(&outfile, outfileName, APR_READ, APR_OS_DEFAULT, pool); if (status) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - fail (pool, status, "failed to open '%s'", outfileName); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + fail(pool, status, "failed to open '%s'", outfileName); } // now we can read the diff output from outfile and return that - error = svn_stringbuf_from_aprfile (&stringbuf, outfile, pool); + error = svn_stringbuf_from_aprfile(&stringbuf, outfile, pool); if (error != NULL) { - diffCleanup (outfile, outfileName, errfile, errfileName, pool); - throw ClientException (error); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); + throw ClientException(error); } - diffCleanup (outfile, outfileName, errfile, errfileName, pool); + diffCleanup(outfile, outfileName, errfile, errfileName, pool); return stringbuf->data; } diff --git a/src/svncpp/client_ls.cpp b/src/svncpp/client_ls.cpp index 6a88e9b2..de63a857 100644 --- a/src/svncpp/client_ls.cpp +++ b/src/svncpp/client_ls.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -38,35 +38,35 @@ static int -compare_items_as_paths (const svn_sort__item_t *a, const svn_sort__item_t *b) +compare_items_as_paths(const svn_sort__item_t *a, const svn_sort__item_t *b) { - return svn_path_compare_paths ((const char *)a->key, (const char *)b->key); + return svn_path_compare_paths((const char *)a->key, (const char *)b->key); } namespace svn { DirEntries - Client::list (const char * pathOrUrl, - svn_opt_revision_t * revision, - bool recurse) throw (ClientException) + Client::list(const char * pathOrUrl, + svn_opt_revision_t * revision, + bool recurse) throw(ClientException) { Pool pool; apr_hash_t * hash; - svn_error_t * error = - svn_client_ls (&hash, - pathOrUrl, - revision, - recurse, - *m_context, - pool); + svn_error_t * error = + svn_client_ls(&hash, + pathOrUrl, + revision, + recurse, + *m_context, + pool); if (error != 0) - throw ClientException (error); + throw ClientException(error); - apr_array_header_t * - array = svn_sort__hash ( - hash, compare_items_as_paths, pool); + apr_array_header_t * + array = svn_sort__hash( + hash, compare_items_as_paths, pool); DirEntries entries; @@ -75,15 +75,15 @@ namespace svn const char *entryname; svn_dirent_t *dirent; svn_sort__item_t *item; - - item = &APR_ARRAY_IDX (array, i, svn_sort__item_t); + + item = &APR_ARRAY_IDX(array, i, svn_sort__item_t); entryname = static_cast(item->key); - dirent = static_cast - (apr_hash_get (hash, entryname, item->klen)); + dirent = static_cast + (apr_hash_get(hash, entryname, item->klen)); - entries.push_back (DirEntry (entryname, dirent)); + entries.push_back(DirEntry(entryname, dirent)); } return entries; diff --git a/src/svncpp/client_modify.cpp b/src/svncpp/client_modify.cpp index 38ff0425..a729e7f6 100644 --- a/src/svncpp/client_modify.cpp +++ b/src/svncpp/client_modify.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -38,201 +38,201 @@ namespace svn { svn_revnum_t - Client::checkout (const char * url, - const Path & destPath, - const Revision & revision, - bool recurse, - bool ignore_externals, - const Revision & peg_revision) throw (ClientException) + Client::checkout(const char * url, + const Path & destPath, + const Revision & revision, + bool recurse, + bool ignore_externals, + const Revision & peg_revision) throw(ClientException) { Pool subPool; - apr_pool_t * apr_pool = subPool.pool (); + apr_pool_t * apr_pool = subPool.pool(); svn_revnum_t revnum = 0; svn_error_t * error = - svn_client_checkout2 (&revnum, - url, - destPath.c_str (), - peg_revision.revision (), // peg_revision - revision.revision (), // revision - recurse, - ignore_externals, - *m_context, - apr_pool); - - if(error != NULL) - throw ClientException (error); + svn_client_checkout2(&revnum, + url, + destPath.c_str(), + peg_revision.revision(), // peg_revision + revision.revision(), // revision + recurse, + ignore_externals, + *m_context, + apr_pool); + + if (error != NULL) + throw ClientException(error); return revnum; } void - Client::remove (const Path & path, - bool force) throw (ClientException) + Client::remove(const Path & path, + bool force) throw(ClientException) { Pool pool; - Targets targets (path.c_str ()); + Targets targets(path.c_str()); svn_client_commit_info_t *commit_info = NULL; svn_error_t * error = - svn_client_delete (&commit_info, - const_cast (targets.array (pool)), - force, - *m_context, - pool); - if(error != NULL) - throw ClientException (error); + svn_client_delete(&commit_info, + const_cast(targets.array(pool)), + force, + *m_context, + pool); + if (error != NULL) + throw ClientException(error); } void - Client::remove (const Targets & targets, - bool force) throw (ClientException) + Client::remove(const Targets & targets, + bool force) throw(ClientException) { Pool pool; svn_client_commit_info_t *commit_info = NULL; svn_error_t * error = - svn_client_delete (&commit_info, - const_cast (targets.array (pool)), - force, - *m_context, - pool); - if(error != NULL) - throw ClientException (error); + svn_client_delete(&commit_info, + const_cast(targets.array(pool)), + force, + *m_context, + pool); + if (error != NULL) + throw ClientException(error); } void - Client::lock (const Targets & targets, bool force, - const char * comment) throw (ClientException) + Client::lock(const Targets & targets, bool force, + const char * comment) throw(ClientException) { Pool pool; svn_error_t * error = - svn_client_lock (const_cast (targets.array (pool)), - comment, - force, - *m_context, - pool); - if(error != NULL) - throw ClientException (error); + svn_client_lock(const_cast(targets.array(pool)), + comment, + force, + *m_context, + pool); + if (error != NULL) + throw ClientException(error); } void - Client::unlock (const Targets & targets, bool force) throw (ClientException) + Client::unlock(const Targets & targets, bool force) throw(ClientException) { Pool pool; svn_error_t * error = - svn_client_unlock (const_cast (targets.array (pool)), - force, - *m_context, - pool); - if(error != NULL) - throw ClientException (error); + svn_client_unlock(const_cast(targets.array(pool)), + force, + *m_context, + pool); + if (error != NULL) + throw ClientException(error); } void - Client::revert (const Targets & targets, - bool recurse) throw (ClientException) + Client::revert(const Targets & targets, + bool recurse) throw(ClientException) { Pool pool; svn_error_t * error = - svn_client_revert ((targets.array (pool)), - recurse, - *m_context, - pool); + svn_client_revert((targets.array(pool)), + recurse, + *m_context, + pool); - if(error != NULL) - throw ClientException (error); + if (error != NULL) + throw ClientException(error); } void - Client::add (const Path & path, - bool recurse) throw (ClientException) + Client::add(const Path & path, + bool recurse) throw(ClientException) { Pool pool; // we do not need the newer version of this // function "svn_client_add2" or "svn_client_add3" // since RapidSVN doesnt even have a dialog - // for adding false + // for adding false svn_error_t * error = - svn_client_add (path.c_str (), - recurse, - *m_context, - pool); + svn_client_add(path.c_str(), + recurse, + *m_context, + pool); - if(error != NULL) - throw ClientException (error); + if (error != NULL) + throw ClientException(error); } std::vector - Client::update (const Targets & targets, - const Revision & revision, - bool recurse, - bool ignore_externals) throw (ClientException) + Client::update(const Targets & targets, + const Revision & revision, + bool recurse, + bool ignore_externals) throw(ClientException) { Pool pool; apr_array_header_t * result_revs; svn_error_t * error = - svn_client_update2 (&result_revs, - const_cast (targets.array (pool)), - revision.revision (), - recurse, - ignore_externals, - *m_context, - pool); - if(error != NULL) - throw ClientException (error); + svn_client_update2(&result_revs, + const_cast(targets.array(pool)), + revision.revision(), + recurse, + ignore_externals, + *m_context, + pool); + if (error != NULL) + throw ClientException(error); std::vector revnums; int i; for (i = 0; i < result_revs->nelts; i++) { - svn_revnum_t revnum= - APR_ARRAY_IDX (result_revs, i, svn_revnum_t); - - revnums.push_back (revnum); + svn_revnum_t revnum= + APR_ARRAY_IDX(result_revs, i, svn_revnum_t); + + revnums.push_back(revnum); } - + return revnums; } svn_revnum_t - Client::update (const Path & path, - const Revision & revision, - bool recurse, - bool ignore_externals) throw (ClientException) + Client::update(const Path & path, + const Revision & revision, + bool recurse, + bool ignore_externals) throw(ClientException) { - Targets targets (path.c_str ()); - return update (targets, revision, recurse, ignore_externals) [0]; + Targets targets(path.c_str()); + return update(targets, revision, recurse, ignore_externals)[0]; } svn_revnum_t - Client::commit (const Targets & targets, - const char * message, - bool recurse, - bool keep_locks) throw (ClientException) + Client::commit(const Targets & targets, + const char * message, + bool recurse, + bool keep_locks) throw(ClientException) { Pool pool; - m_context->setLogMessage (message); + m_context->setLogMessage(message); svn_client_commit_info_t *commit_info = NULL; svn_error_t * error = - svn_client_commit2 (&commit_info, - targets.array (pool), - recurse, + svn_client_commit2(&commit_info, + targets.array(pool), + recurse, keep_locks, *m_context, pool); if (error != NULL) - throw ClientException (error); + throw ClientException(error); - if (commit_info && SVN_IS_VALID_REVNUM (commit_info->revision)) + if (commit_info && SVN_IS_VALID_REVNUM(commit_info->revision)) return commit_info->revision; return -1; @@ -240,281 +240,281 @@ namespace svn void - Client::copy (const Path & srcPath, - const Revision & srcRevision, - const Path & destPath) throw (ClientException) + Client::copy(const Path & srcPath, + const Revision & srcRevision, + const Path & destPath) throw(ClientException) { Pool pool; svn_client_commit_info_t *commit_info = NULL; - svn_error_t * error = - svn_client_copy (&commit_info, - srcPath.c_str (), - srcRevision.revision (), - destPath.c_str (), - *m_context, - pool); - - if(error != NULL) - throw ClientException (error); + svn_error_t * error = + svn_client_copy(&commit_info, + srcPath.c_str(), + srcRevision.revision(), + destPath.c_str(), + *m_context, + pool); + + if (error != NULL) + throw ClientException(error); } void - Client::move (const Path & srcPath, - const Revision & srcRevision, - const Path & destPath, - bool force) throw (ClientException) + Client::move(const Path & srcPath, + const Revision & srcRevision, + const Path & destPath, + bool force) throw(ClientException) { Pool pool; svn_client_commit_info_t *commit_info = NULL; - svn_error_t * error = - svn_client_move2 (&commit_info, - srcPath.c_str (), - destPath.c_str (), - force, - *m_context, - pool); + svn_error_t * error = + svn_client_move2(&commit_info, + srcPath.c_str(), + destPath.c_str(), + force, + *m_context, + pool); - if(error != NULL) - throw ClientException (error); + if (error != NULL) + throw ClientException(error); } void - Client::mkdir (const Path & path) throw (ClientException) + Client::mkdir(const Path & path) throw(ClientException) { Pool pool; - Targets targets (path.c_str ()); + Targets targets(path.c_str()); svn_client_commit_info_t *commit_info = NULL; - svn_error_t * error = - svn_client_mkdir (&commit_info, - const_cast - (targets.array (pool)), - *m_context, pool); - - if(error != NULL) - throw ClientException (error); + svn_error_t * error = + svn_client_mkdir(&commit_info, + const_cast + (targets.array(pool)), + *m_context, pool); + + if (error != NULL) + throw ClientException(error); } void - Client::mkdir (const Targets & targets) throw (ClientException) + Client::mkdir(const Targets & targets) throw(ClientException) { Pool pool; svn_client_commit_info_t *commit_info = NULL; - svn_error_t * error = - svn_client_mkdir (&commit_info, - const_cast - (targets.array (pool)), - *m_context, pool); - - if(error != NULL) - throw ClientException (error); + svn_error_t * error = + svn_client_mkdir(&commit_info, + const_cast + (targets.array(pool)), + *m_context, pool); + + if (error != NULL) + throw ClientException(error); } void - Client::cleanup (const Path & path) throw (ClientException) + Client::cleanup(const Path & path) throw(ClientException) { Pool subPool; - apr_pool_t * apr_pool = subPool.pool (); + apr_pool_t * apr_pool = subPool.pool(); - svn_error_t * error = - svn_client_cleanup (path.c_str (), *m_context, apr_pool); + svn_error_t * error = + svn_client_cleanup(path.c_str(), *m_context, apr_pool); - if(error != NULL) - throw ClientException (error); + if (error != NULL) + throw ClientException(error); } void - Client::resolved (const Path & path, - bool recurse) throw (ClientException) + Client::resolved(const Path & path, + bool recurse) throw(ClientException) { Pool pool; - svn_error_t * error = - svn_client_resolved (path.c_str (), - recurse, - *m_context, - pool); + svn_error_t * error = + svn_client_resolved(path.c_str(), + recurse, + *m_context, + pool); - if(error != NULL) - throw ClientException (error); + if (error != NULL) + throw ClientException(error); } void - Client::doExport (const Path & from_path, - const Path & to_path, - const Revision & revision, - bool overwrite, - const Revision & peg_revision, - bool ignore_externals, - bool recurse, - const char * native_eol) throw (ClientException) + Client::doExport(const Path & from_path, + const Path & to_path, + const Revision & revision, + bool overwrite, + const Revision & peg_revision, + bool ignore_externals, + bool recurse, + const char * native_eol) throw(ClientException) { Pool pool; svn_revnum_t revnum = 0; - svn_error_t * error = - svn_client_export3 (&revnum, - from_path.c_str (), - to_path.c_str (), - peg_revision.revision (), - revision.revision (), - overwrite, - ignore_externals, - recurse, - native_eol, - *m_context, - pool); + svn_error_t * error = + svn_client_export3(&revnum, + from_path.c_str(), + to_path.c_str(), + peg_revision.revision(), + revision.revision(), + overwrite, + ignore_externals, + recurse, + native_eol, + *m_context, + pool); - if(error != NULL) - throw ClientException (error); + if (error != NULL) + throw ClientException(error); } svn_revnum_t - Client::doSwitch (const Path & path, - const char * url, - const Revision & revision, - bool recurse) throw (ClientException) + Client::doSwitch(const Path & path, + const char * url, + const Revision & revision, + bool recurse) throw(ClientException) { Pool pool; svn_revnum_t revnum = 0; - svn_error_t * error = - svn_client_switch (&revnum, - path.c_str (), - url, - revision.revision (), - recurse, - *m_context, - pool); - - if(error != NULL) - throw ClientException (error); + svn_error_t * error = + svn_client_switch(&revnum, + path.c_str(), + url, + revision.revision(), + recurse, + *m_context, + pool); + + if (error != NULL) + throw ClientException(error); return revnum; } void - Client::import (const Path & path, - const char * url, - const char * message, - bool recurse) throw (ClientException) + Client::import(const Path & path, + const char * url, + const char * message, + bool recurse) throw(ClientException) { Pool pool; svn_client_commit_info_t *commit_info = NULL; - m_context->setLogMessage (message); + m_context->setLogMessage(message); - svn_error_t * error = - svn_client_import (&commit_info, - path.c_str (), - url, - !recurse, - *m_context, - pool); + svn_error_t * error = + svn_client_import(&commit_info, + path.c_str(), + url, + !recurse, + *m_context, + pool); - if(error != NULL) - throw ClientException (error); + if (error != NULL) + throw ClientException(error); } void - Client::import (const Path & path, - const Path & url, - const char * message, - bool recurse) throw (ClientException) + Client::import(const Path & path, + const Path & url, + const char * message, + bool recurse) throw(ClientException) { - import (path, url.c_str (), message, recurse); + import(path, url.c_str(), message, recurse); } void - Client::merge (const Path & path1, const Revision & revision1, - const Path & path2, const Revision & revision2, - const Path & localPath, bool force, - bool recurse, - bool notice_ancestry, - bool dry_run) throw (ClientException) + Client::merge(const Path & path1, const Revision & revision1, + const Path & path2, const Revision & revision2, + const Path & localPath, bool force, + bool recurse, + bool notice_ancestry, + bool dry_run) throw(ClientException) { Pool pool; - svn_error_t * error = - svn_client_merge (path1.c_str (), - revision1.revision (), - path2.c_str (), - revision2.revision (), - localPath.c_str (), - recurse, - !notice_ancestry, - force, - dry_run, - *m_context, - pool); + svn_error_t * error = + svn_client_merge(path1.c_str(), + revision1.revision(), + path2.c_str(), + revision2.revision(), + localPath.c_str(), + recurse, + !notice_ancestry, + force, + dry_run, + *m_context, + pool); - if(error != NULL) - throw ClientException (error); + if (error != NULL) + throw ClientException(error); } void - Client::relocate (const Path & path, - const char * from_url, - const char * to_url, - bool recurse) throw (ClientException) + Client::relocate(const Path & path, + const char * from_url, + const char * to_url, + bool recurse) throw(ClientException) { Pool pool; - svn_error_t * error = - svn_client_relocate (path.c_str (), - from_url, - to_url, - recurse, - *m_context, - pool); - - if(error != NULL) - throw ClientException (error); + svn_error_t * error = + svn_client_relocate(path.c_str(), + from_url, + to_url, + recurse, + *m_context, + pool); + + if (error != NULL) + throw ClientException(error); } void - Client::ignore (const Path & path) throw (ClientException) + Client::ignore(const Path & path) throw(ClientException) { static const char s_svnIgnore[] = "svn:ignore"; Pool pool; - + std::string dirpath, basename; - path.split (dirpath, basename); + path.split(dirpath, basename); Revision revision; apr_hash_t *props; svn_error_t * error = - svn_client_propget (&props, - s_svnIgnore, - dirpath.c_str (), - Revision::UNSPECIFIED.revision (), - false, // recursive - *m_context, - pool); + svn_client_propget(&props, + s_svnIgnore, + dirpath.c_str(), + Revision::UNSPECIFIED.revision(), + false, // recursive + *m_context, + pool); if (error != NULL) - throw ClientException (error); + throw ClientException(error); PathPropertiesMapList path_prop_map_list; apr_hash_index_t *hi; - for (hi = apr_hash_first (pool, props); hi; - hi = apr_hash_next (hi)) + for (hi = apr_hash_first(pool, props); hi; + hi = apr_hash_next(hi)) { PropertiesMap prop_map; const void *key; void *val; - apr_hash_this (hi, &key, NULL, &val); + apr_hash_this(hi, &key, NULL, &val); - prop_map [std::string (s_svnIgnore)] = std::string (((const svn_string_t *)val)->data); + prop_map [std::string(s_svnIgnore)] = std::string(((const svn_string_t *)val)->data); - path_prop_map_list.push_back (PathPropertiesMapEntry ((const char *)key, prop_map)); + path_prop_map_list.push_back(PathPropertiesMapEntry((const char *)key, prop_map)); } std::string str = basename; - for (PathPropertiesMapList::const_iterator i=path_prop_map_list.begin (), ei=path_prop_map_list.end ();i!=ei;++i) + for (PathPropertiesMapList::const_iterator i=path_prop_map_list.begin(), ei=path_prop_map_list.end();i!=ei;++i) { if (dirpath != i->first) continue; - for (PropertiesMap::const_iterator j=i->second.begin (), ej=i->second.end (); j != ej; ++j) + for (PropertiesMap::const_iterator j=i->second.begin(), ej=i->second.end(); j != ej; ++j) { if (s_svnIgnore != j->first) continue; @@ -522,26 +522,26 @@ namespace svn } } const svn_string_t * propval = - svn_string_create (str.c_str (), pool); + svn_string_create(str.c_str(), pool); error = - svn_client_propset2 (s_svnIgnore, - propval, - dirpath.c_str (), - false, - false, - *m_context, - pool); + svn_client_propset2(s_svnIgnore, + propval, + dirpath.c_str(), + false, + false, + *m_context, + pool); if (error != NULL) - throw ClientException (error); + throw ClientException(error); } void - Client::ignore (const Targets & targets) throw (ClientException) + Client::ignore(const Targets & targets) throw(ClientException) { // it's slow, but simple - for (std::vector::const_iterator i=targets.targets ().begin (), e=targets.targets ().end ();i!=e;++i) + for (std::vector::const_iterator i=targets.targets().begin(), e=targets.targets().end();i!=e;++i) { - ignore (*i); + ignore(*i); } } diff --git a/src/svncpp/client_property.cpp b/src/svncpp/client_property.cpp index 7375146a..d7811c0e 100644 --- a/src/svncpp/client_property.cpp +++ b/src/svncpp/client_property.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -48,47 +48,47 @@ namespace svn * @return PropertiesList */ PathPropertiesMapList - Client::proplist (const Path & path, - const Revision & revision, - bool recurse) + Client::proplist(const Path & path, + const Revision & revision, + bool recurse) { Pool pool; apr_array_header_t * props; svn_error_t * error = - svn_client_proplist (&props, - path.c_str (), - revision.revision (), - recurse, - *m_context, - pool); + svn_client_proplist(&props, + path.c_str(), + revision.revision(), + recurse, + *m_context, + pool); if (error != NULL) { - throw ClientException (error); + throw ClientException(error); } PathPropertiesMapList path_prop_map_list; for (int j = 0; j < props->nelts; ++j) { - svn_client_proplist_item_t *item = + svn_client_proplist_item_t *item = ((svn_client_proplist_item_t **)props->elts)[j]; PropertiesMap prop_map; apr_hash_index_t *hi; - for (hi = apr_hash_first (pool, item->prop_hash); hi; - hi = apr_hash_next (hi)) + for (hi = apr_hash_first(pool, item->prop_hash); hi; + hi = apr_hash_next(hi)) { const void *key; void *val; - apr_hash_this (hi, &key, NULL, &val); + apr_hash_this(hi, &key, NULL, &val); - prop_map [std::string ((const char *)key)] = - std::string (((const svn_string_t *)val)->data); + prop_map [std::string((const char *)key)] = + std::string(((const svn_string_t *)val)->data); } - path_prop_map_list.push_back (PathPropertiesMapEntry (item->node_name->data, prop_map)); + path_prop_map_list.push_back(PathPropertiesMapEntry(item->node_name->data, prop_map)); } return path_prop_map_list; @@ -103,46 +103,46 @@ namespace svn * @param recurse * @return PropertiesList */ - + PathPropertiesMapList - Client::propget (const char *propName, - const Path &path, - const Revision &revision, - bool recurse) + Client::propget(const char *propName, + const Path &path, + const Revision &revision, + bool recurse) { Pool pool; apr_hash_t *props; svn_error_t * error = - svn_client_propget (&props, - propName, - path.c_str (), - revision.revision (), - recurse, - *m_context, - pool); + svn_client_propget(&props, + propName, + path.c_str(), + revision.revision(), + recurse, + *m_context, + pool); if (error != NULL) { - throw ClientException (error); + throw ClientException(error); } PathPropertiesMapList path_prop_map_list; apr_hash_index_t *hi; - for (hi = apr_hash_first (pool, props); hi; - hi = apr_hash_next (hi)) + for (hi = apr_hash_first(pool, props); hi; + hi = apr_hash_next(hi)) { PropertiesMap prop_map; const void *key; void *val; - apr_hash_this (hi, &key, NULL, &val); + apr_hash_this(hi, &key, NULL, &val); - prop_map [std::string (propName)] = std::string (((const svn_string_t *)val)->data); + prop_map [std::string(propName)] = std::string(((const svn_string_t *)val)->data); - path_prop_map_list.push_back (PathPropertiesMapEntry ((const char *)key, prop_map)); + path_prop_map_list.push_back(PathPropertiesMapEntry((const char *)key, prop_map)); } return path_prop_map_list; @@ -160,28 +160,28 @@ namespace svn * @return PropertiesList */ void - Client::propset (const char * propName, - const char * propValue, - const Path & path, - const Revision & revision, - bool recurse, - bool skip_checks) + Client::propset(const char * propName, + const char * propValue, + const Path & path, + const Revision & revision, + bool recurse, + bool skip_checks) { Pool pool; const svn_string_t * propval = - svn_string_create ((const char *) propValue, pool); - - svn_error_t * error = - svn_client_propset2 (propName, - propval, - path.c_str (), - recurse, - skip_checks, - *m_context, - pool); + svn_string_create((const char *) propValue, pool); + + svn_error_t * error = + svn_client_propset2(propName, + propval, + path.c_str(), + recurse, + skip_checks, + *m_context, + pool); if (error != NULL) - throw ClientException (error); + throw ClientException(error); } /** @@ -196,23 +196,23 @@ namespace svn * @return PropertiesList */ void - Client::propdel (const char *propName, - const Path &path, - const Revision &revision, - bool recurse) + Client::propdel(const char *propName, + const Path &path, + const Revision &revision, + bool recurse) { Pool pool; - svn_error_t * error = - svn_client_propset (propName, - NULL, // value = NULL - path.c_str (), - recurse, - pool); + svn_error_t * error = + svn_client_propset(propName, + NULL, // value = NULL + path.c_str(), + recurse, + pool); if (error != NULL) - throw ClientException (error); + throw ClientException(error); } - + //-------------------------------------------------------------------------------- // // revprop functions @@ -228,38 +228,38 @@ namespace svn * @return PropertiesList */ std::pair - Client::revproplist (const Path &path, - const Revision &revision) + Client::revproplist(const Path &path, + const Revision &revision) { Pool pool; apr_hash_t * props; svn_revnum_t revnum; svn_error_t * error = - svn_client_revprop_list (&props, - path.c_str (), - revision.revision (), - &revnum, - *m_context, - pool); - if(error != NULL) + svn_client_revprop_list(&props, + path.c_str(), + revision.revision(), + &revnum, + *m_context, + pool); + if (error != NULL) { - throw ClientException (error); + throw ClientException(error); } PropertiesMap prop_map; apr_hash_index_t *hi; - for (hi = apr_hash_first (pool, props); hi; - hi = apr_hash_next (hi)) + for (hi = apr_hash_first(pool, props); hi; + hi = apr_hash_next(hi)) { const void *key; void *val; - apr_hash_this (hi, &key, NULL, &val); + apr_hash_this(hi, &key, NULL, &val); - prop_map [std::string ((const char *)key)] = - std::string (((const svn_string_t *)val)->data); + prop_map [std::string((const char *)key)] = + std::string(((const svn_string_t *)val)->data); } return std::pair (revnum, prop_map); @@ -274,34 +274,34 @@ namespace svn * @param recurse * @return PropertiesList */ - + std::pair - Client::revpropget (const char *propName, - const Path &path, - const Revision &revision) + Client::revpropget(const char *propName, + const Path &path, + const Revision &revision) { Pool pool; svn_string_t *propval; svn_revnum_t revnum; svn_error_t * error = - svn_client_revprop_get (propName, - &propval, - path.c_str (), - revision.revision (), - &revnum, - *m_context, - pool); + svn_client_revprop_get(propName, + &propval, + path.c_str(), + revision.revision(), + &revnum, + *m_context, + pool); if (error != NULL) { - throw ClientException (error); + throw ClientException(error); } // if the property does not exist NULL is returned if (propval == NULL) return std::pair (0, std::string()); - return std::pair (revnum, std::string (propval->data)); + return std::pair (revnum, std::string(propval->data)); } /** @@ -317,29 +317,29 @@ namespace svn * @return PropertiesList */ svn_revnum_t - Client::revpropset (const char *propName, - const char *propValue, - const Path &path, - const Revision &revision, - bool force) + Client::revpropset(const char *propName, + const char *propValue, + const Path &path, + const Revision &revision, + bool force) { Pool pool; - const svn_string_t * propval - = svn_string_create ((const char *) propValue, pool); + const svn_string_t * propval + = svn_string_create((const char *) propValue, pool); svn_revnum_t revnum; - svn_error_t * error = - svn_client_revprop_set (propName, - propval, - path.c_str (), - revision.revision (), - &revnum, - force, - *m_context, - pool); - if(error != NULL) - throw ClientException (error); + svn_error_t * error = + svn_client_revprop_set(propName, + propval, + path.c_str(), + revision.revision(), + &revnum, + force, + *m_context, + pool); + if (error != NULL) + throw ClientException(error); return revnum; } @@ -357,25 +357,25 @@ namespace svn * @return PropertiesList */ svn_revnum_t - Client::revpropdel (const char *propName, - const Path &path, - const Revision &revision, - bool force) + Client::revpropdel(const char *propName, + const Path &path, + const Revision &revision, + bool force) { Pool pool; svn_revnum_t revnum; - svn_error_t * error = - svn_client_revprop_set (propName, - NULL, // value = NULL - path.c_str (), - revision.revision (), - &revnum, - force, - *m_context, - pool); + svn_error_t * error = + svn_client_revprop_set(propName, + NULL, // value = NULL + path.c_str(), + revision.revision(), + &revnum, + force, + *m_context, + pool); if (error != NULL) - throw ClientException (error); + throw ClientException(error); return revnum; } diff --git a/src/svncpp/client_status.cpp b/src/svncpp/client_status.cpp index 4a49b63f..bd1e76c6 100644 --- a/src/svncpp/client_status.cpp +++ b/src/svncpp/client_status.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -46,114 +46,114 @@ namespace svn { static svn_error_t * - logReceiver (void *baton, - apr_hash_t * changedPaths, - svn_revnum_t rev, - const char *author, - const char *date, - const char *msg, - apr_pool_t * pool) + logReceiver(void *baton, + apr_hash_t * changedPaths, + svn_revnum_t rev, + const char *author, + const char *date, + const char *msg, + apr_pool_t * pool) { LogEntries * entries = (LogEntries *) baton; - entries->insert (entries->begin (), LogEntry (rev, author, date, msg)); + entries->insert(entries->begin(), LogEntry(rev, author, date, msg)); if (changedPaths != NULL) { - LogEntry &entry = entries->front (); + LogEntry &entry = entries->front(); - for (apr_hash_index_t *hi = apr_hash_first (pool, changedPaths); + for (apr_hash_index_t *hi = apr_hash_first(pool, changedPaths); hi != NULL; - hi = apr_hash_next (hi)) + hi = apr_hash_next(hi)) { char *path; void *val; - apr_hash_this (hi, (const void **)&path, NULL, &val); - - svn_log_changed_path_t *log_item = reinterpret_cast (val); - - entry.changedPaths.push_back ( - LogChangePathEntry (path, - log_item->action, - log_item->copyfrom_path, - log_item->copyfrom_rev) ); + apr_hash_this(hi, (const void **)&path, NULL, &val); + + svn_log_changed_path_t *log_item = reinterpret_cast(val); + + entry.changedPaths.push_back( + LogChangePathEntry(path, + log_item->action, + log_item->copyfrom_path, + log_item->copyfrom_rev)); } } return NULL; } - static void - statusEntriesFunc (void *baton, - const char *path, - svn_wc_status2_t *status) + static void + statusEntriesFunc(void *baton, + const char *path, + svn_wc_status2_t *status) { StatusEntries * entries = static_cast(baton); - entries->push_back (Status (path, status)); + entries->push_back(Status(path, status)); } static StatusEntries - localStatus (const char * path, - const bool descend, - const bool get_all, - const bool update, - const bool no_ignore, - Context * context, - const bool ignore_externals) + localStatus(const char * path, + const bool descend, + const bool get_all, + const bool update, + const bool no_ignore, + Context * context, + const bool ignore_externals) { svn_error_t *error; StatusEntries entries; svn_revnum_t revnum; - Revision rev (Revision::HEAD); + Revision rev(Revision::HEAD); Pool pool; - error = svn_client_status2 ( - &revnum, // revnum - path, // path - rev, // revision - statusEntriesFunc, // status func - &entries, // status baton - descend, // recurse - get_all, - update, // need 'update' to be true to get repository lock info - no_ignore, - ignore_externals, // ignore_externals - *context, // client ctx - pool); + error = svn_client_status2( + &revnum, // revnum + path, // path + rev, // revision + statusEntriesFunc, // status func + &entries, // status baton + descend, // recurse + get_all, + update, // need 'update' to be true to get repository lock info + no_ignore, + ignore_externals, // ignore_externals + *context, // client ctx + pool); if (error!=NULL) - throw ClientException (error); + throw ClientException(error); return entries; } - - static Status - dirEntryToStatus (const char * path, const DirEntry & dirEntry) + + static Status + dirEntryToStatus(const char * path, const DirEntry & dirEntry) { Pool pool; svn_wc_entry_t * e = - static_cast ( - apr_pcalloc (pool, sizeof (svn_wc_entry_t))); + static_cast( + apr_pcalloc(pool, sizeof(svn_wc_entry_t))); - std::string url (path); + std::string url(path); url += "/"; - url += dirEntry.name (); + url += dirEntry.name(); - e->name = dirEntry.name (); - e->revision = dirEntry.createdRev (); - e->url = url.c_str (); - e->kind = dirEntry.kind (); + e->name = dirEntry.name(); + e->revision = dirEntry.createdRev(); + e->url = url.c_str(); + e->kind = dirEntry.kind(); e->schedule = svn_wc_schedule_normal; - e->text_time = dirEntry.time (); - e->prop_time = dirEntry.time (); - e->cmt_rev = dirEntry.createdRev (); - e->cmt_date = dirEntry.time (); - e->cmt_author = dirEntry.lastAuthor (); + e->text_time = dirEntry.time(); + e->prop_time = dirEntry.time(); + e->cmt_rev = dirEntry.createdRev(); + e->cmt_date = dirEntry.time(); + e->cmt_author = dirEntry.lastAuthor(); svn_wc_status2_t * s = - static_cast ( - apr_pcalloc (pool, sizeof (svn_wc_status2_t))); + static_cast( + apr_pcalloc(pool, sizeof(svn_wc_status2_t))); s->entry = e; s->text_status = svn_wc_status_normal; s->prop_status = svn_wc_status_normal; @@ -162,74 +162,74 @@ namespace svn s->repos_text_status = svn_wc_status_normal; s->repos_prop_status = svn_wc_status_normal; - return Status (url.c_str (), s); + return Status(url.c_str(), s); } static svn_revnum_t - remoteStatus (Client * client, - const char * path, - const bool descend, - StatusEntries & entries, - Context * context) + remoteStatus(Client * client, + const char * path, + const bool descend, + StatusEntries & entries, + Context * context) { - Revision rev (Revision::HEAD); - DirEntries dirEntries = client->list (path, rev, descend); + Revision rev(Revision::HEAD); + DirEntries dirEntries = client->list(path, rev, descend); DirEntries::const_iterator it; svn_revnum_t revnum = 0; - - for (it = dirEntries.begin (); it != dirEntries.end (); it++) + + for (it = dirEntries.begin(); it != dirEntries.end(); it++) { const DirEntry & dirEntry = *it; - entries.push_back (dirEntryToStatus (path, dirEntry)); + entries.push_back(dirEntryToStatus(path, dirEntry)); } - if (dirEntries.size () > 0) - revnum = dirEntries[0].createdRev (); - + if (dirEntries.size() > 0) + revnum = dirEntries[0].createdRev(); + return revnum; } - StatusEntries - Client::status (const char * path, - const bool descend, - const bool get_all, - const bool update, - const bool no_ignore, - const bool ignore_externals) throw (ClientException) + StatusEntries + Client::status(const char * path, + const bool descend, + const bool get_all, + const bool update, + const bool no_ignore, + const bool ignore_externals) throw(ClientException) { - if (Url::isValid (path)) + if (Url::isValid(path)) { StatusEntries entries; - remoteStatus (this, path, descend, entries, m_context); + remoteStatus(this, path, descend, entries, m_context); return entries; } else - return localStatus (path, descend, get_all, update, - no_ignore, m_context, ignore_externals); + return localStatus(path, descend, get_all, update, + no_ignore, m_context, ignore_externals); } struct StatusFilter; struct StatusBaton { - public: +public: const StatusFilter & filter; StatusEntries & entries; - StatusBaton (const StatusFilter & filter_, StatusEntries & entries_) - : filter (filter_), entries (entries_) + StatusBaton(const StatusFilter & filter_, StatusEntries & entries_) + : filter(filter_), entries(entries_) { } }; - static void - filteredStatusFunc (void *baton_, - const char *path, - svn_wc_status2_t *status) + static void + filteredStatusFunc(void *baton_, + const char *path, + svn_wc_status2_t *status) { StatusBaton * baton = static_cast(baton_); @@ -239,7 +239,7 @@ namespace svn bool useStatus = false; - bool isUnversioned = 0 == status->entry; + bool isUnversioned = 0 == status->entry; if (isUnversioned) { // unversioned if (baton->filter.showUnversioned) @@ -247,7 +247,7 @@ namespace svn } else { - bool isUnmodified = + bool isUnmodified = ((svn_wc_status_normal == status->text_status) && (svn_wc_status_normal == status->prop_status)); @@ -269,142 +269,142 @@ namespace svn } } } - + if (useStatus) - baton->entries.push_back (Status (path, status)); + baton->entries.push_back(Status(path, status)); } static svn_revnum_t - localFilteredStatus (const char * path, - const StatusFilter & filter, - const bool descend, - const bool update, - StatusEntries & entries, - Context * context) + localFilteredStatus(const char * path, + const StatusFilter & filter, + const bool descend, + const bool update, + StatusEntries & entries, + Context * context) { svn_error_t *error; svn_revnum_t revnum; - Revision rev (Revision::HEAD); + Revision rev(Revision::HEAD); Pool pool; - StatusBaton baton (filter, entries); - - error = svn_client_status2 ( - &revnum, // revnum - path, // path - rev, // revision - filteredStatusFunc, // status func - &baton, // status baton - descend, // recurse - filter.showUnmodified, - update, // need 'update' to be true to get repository lock info - filter.showIgnored, // no_ignores - !filter.showExternals, // ignore_externals - *context, // client ctx - pool); + StatusBaton baton(filter, entries); + + error = svn_client_status2( + &revnum, // revnum + path, // path + rev, // revision + filteredStatusFunc, // status func + &baton, // status baton + descend, // recurse + filter.showUnmodified, + update, // need 'update' to be true to get repository lock info + filter.showIgnored, // no_ignores + !filter.showExternals, // ignore_externals + *context, // client ctx + pool); if (error!=NULL) - throw ClientException (error); + throw ClientException(error); return revnum; } svn_revnum_t - Client::status (const char * path, - const StatusFilter & filter, - const bool descend, - const bool update, - StatusEntries & entries) throw (ClientException) + Client::status(const char * path, + const StatusFilter & filter, + const bool descend, + const bool update, + StatusEntries & entries) throw(ClientException) { - entries.clear (); + entries.clear(); - if (Url::isValid (path)) - return remoteStatus (this, path, descend, - entries, m_context); + if (Url::isValid(path)) + return remoteStatus(this, path, descend, + entries, m_context); else { // remote URLs only need a subset of the filters: // we dont expect any modified, conflicting, unknown, // ignored entries. And externals arent visible there anyhow - return localFilteredStatus ( - path, filter, descend, update, entries, m_context); + return localFilteredStatus( + path, filter, descend, update, entries, m_context); } } const LogEntries * - Client::log (const char * path, const Revision & revisionStart, - const Revision & revisionEnd, bool discoverChangedPaths, - bool strictNodeHistory ) throw (ClientException) + Client::log(const char * path, const Revision & revisionStart, + const Revision & revisionEnd, bool discoverChangedPaths, + bool strictNodeHistory) throw(ClientException) { Pool pool; - Targets target (path); - LogEntries * entries = new LogEntries (); + Targets target(path); + LogEntries * entries = new LogEntries(); svn_error_t *error; int limit = 0; - error = svn_client_log2 ( - target.array (pool), - revisionStart.revision (), - revisionEnd.revision (), - limit, - discoverChangedPaths ? 1 : 0, - strictNodeHistory ? 1 : 0, - logReceiver, - entries, - *m_context, // client ctx - pool); + error = svn_client_log2( + target.array(pool), + revisionStart.revision(), + revisionEnd.revision(), + limit, + discoverChangedPaths ? 1 : 0, + strictNodeHistory ? 1 : 0, + logReceiver, + entries, + *m_context, // client ctx + pool); if (error != NULL) { delete entries; - throw ClientException (error); + throw ClientException(error); } return entries; } - /** + /** * callback function for Client::info, will be * called for every entry svn_client_info wants to * return */ static svn_error_t * - infoReceiverFunc (void * baton, const char * path, - const svn_info_t * info, - apr_pool_t * pool) + infoReceiverFunc(void * baton, const char * path, + const svn_info_t * info, + apr_pool_t * pool) { InfoVector * infoVector = static_cast(baton); - infoVector->push_back (Info (path, info)); + infoVector->push_back(Info(path, info)); return 0; } InfoVector - Client::info (const Path & pathOrUrl, - bool recurse, - const Revision & revision, - const Revision & pegRevision) throw (ClientException) + Client::info(const Path & pathOrUrl, + bool recurse, + const Revision & revision, + const Revision & pegRevision) throw(ClientException) { Pool pool; InfoVector infoVector; - + svn_error_t * error = - svn_client_info (pathOrUrl.c_str (), - pegRevision.revision (), - revision.revision (), - infoReceiverFunc, - &infoVector, - recurse, - *m_context, - pool); + svn_client_info(pathOrUrl.c_str(), + pegRevision.revision(), + revision.revision(), + infoReceiverFunc, + &infoVector, + recurse, + *m_context, + pool); if (error != 0) - throw ClientException (error); + throw ClientException(error); return infoVector; } diff --git a/src/svncpp/context.cpp b/src/svncpp/context.cpp index 6a5c875d..464772db 100644 --- a/src/svncpp/context.cpp +++ b/src/svncpp/context.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -55,7 +55,7 @@ namespace svn { struct Context::Data { - public: +public: /** The usage of Apr makes sure Apr is initialized * before any use of apr functions. */ @@ -72,25 +72,25 @@ namespace svn std::string configDir; /** - * translate native c-string to utf8 + * translate native c-string to utf8 */ - static svn_error_t * - translateString (const char * str, const char ** newStr, - apr_pool_t * pool) + static svn_error_t * + translateString(const char * str, const char ** newStr, + apr_pool_t * pool) { // due to problems with apr_xlate we dont perform // any conversion at this place. YOU will have to make // sure any strings passed are UTF 8 strings // svn_string_t *string = svn_string_create ("", pool); - // + // // string->data = str; // string->len = strlen (str); - // + // // const char * encoding = APR_LOCALE_CHARSET; - // + // // SVN_ERR (svn_subst_translate_string (&string, string, // encoding, pool)); - // + // // *newStr = string->data; *newStr = str; return SVN_NO_ERROR; @@ -109,39 +109,39 @@ namespace svn * @retval SVN_ERR_CANCELLED on invalid values */ static svn_error_t * - getData (void * baton, Data ** data) + getData(void * baton, Data ** data) { if (baton == NULL) - return svn_error_create (SVN_ERR_CANCELLED, NULL, - "invalid baton"); + return svn_error_create(SVN_ERR_CANCELLED, NULL, + "invalid baton"); Data * data_ = static_cast (baton); if (data_->listener == 0) - return svn_error_create (SVN_ERR_CANCELLED, NULL, - "invalid listener"); + return svn_error_create(SVN_ERR_CANCELLED, NULL, + "invalid listener"); *data = data_; return SVN_NO_ERROR; } - Data (const std::string & configDir_) - : listener (0), logIsSet (false), - promptCounter (0), configDir (configDir_) + Data(const std::string & configDir_) + : listener(0), logIsSet(false), + promptCounter(0), configDir(configDir_) { const char * c_configDir = 0; - if( configDir.length () > 0 ) - c_configDir = configDir.c_str (); + if (configDir.length() > 0) + c_configDir = configDir.c_str(); // make sure the configuration directory exists - svn_config_ensure (c_configDir, pool); + svn_config_ensure(c_configDir, pool); // intialize authentication providers - // * simple + // * simple // * username // * simple prompt - // * ssl server trust file + // * ssl server trust file // * ssl server trust prompt // * ssl client cert pw file // * ssl client cert pw prompt @@ -149,66 +149,66 @@ namespace svn // =================== // 8 providers - apr_array_header_t *providers = - apr_array_make (pool, 8, - sizeof (svn_auth_provider_object_t *)); + apr_array_header_t *providers = + apr_array_make(pool, 8, + sizeof(svn_auth_provider_object_t *)); svn_auth_provider_object_t *provider; - svn_client_get_simple_provider ( + svn_client_get_simple_provider( &provider, pool); - *(svn_auth_provider_object_t **)apr_array_push (providers) = + *(svn_auth_provider_object_t **)apr_array_push(providers) = provider; - svn_client_get_username_provider ( + svn_client_get_username_provider( &provider, pool); - *(svn_auth_provider_object_t **)apr_array_push (providers) = + *(svn_auth_provider_object_t **)apr_array_push(providers) = provider; - svn_client_get_simple_prompt_provider ( + svn_client_get_simple_prompt_provider( &provider, onSimplePrompt, this, 100000000, // not very nice. should be infinite... pool); - *(svn_auth_provider_object_t **)apr_array_push (providers) = + *(svn_auth_provider_object_t **)apr_array_push(providers) = provider; - // add ssl providers + // add ssl providers // file first then prompt providers - svn_client_get_ssl_server_trust_file_provider (&provider, pool); - *(svn_auth_provider_object_t **)apr_array_push (providers) = + svn_client_get_ssl_server_trust_file_provider(&provider, pool); + *(svn_auth_provider_object_t **)apr_array_push(providers) = provider; - svn_client_get_ssl_client_cert_file_provider (&provider, pool); - *(svn_auth_provider_object_t **)apr_array_push (providers) = + svn_client_get_ssl_client_cert_file_provider(&provider, pool); + *(svn_auth_provider_object_t **)apr_array_push(providers) = provider; - svn_client_get_ssl_client_cert_pw_file_provider (&provider, pool); - *(svn_auth_provider_object_t **)apr_array_push (providers) = + svn_client_get_ssl_client_cert_pw_file_provider(&provider, pool); + *(svn_auth_provider_object_t **)apr_array_push(providers) = provider; - svn_client_get_ssl_server_trust_prompt_provider ( + svn_client_get_ssl_server_trust_prompt_provider( &provider, onSslServerTrustPrompt, this, pool); - *(svn_auth_provider_object_t **)apr_array_push (providers) = + *(svn_auth_provider_object_t **)apr_array_push(providers) = provider; - // plugged in 3 as the retry limit - what is a good limit? - svn_client_get_ssl_client_cert_pw_prompt_provider ( + // plugged in 3 as the retry limit - what is a good limit? + svn_client_get_ssl_client_cert_pw_prompt_provider( &provider, onSslClientCertPwPrompt, this, 3, pool); - *(svn_auth_provider_object_t **)apr_array_push (providers) = + *(svn_auth_provider_object_t **)apr_array_push(providers) = provider; svn_auth_baton_t *ab; - svn_auth_open (&ab, providers, pool); + svn_auth_open(&ab, providers, pool); // initialize ctx structure - memset (&ctx, 0, sizeof (ctx)); + memset(&ctx, 0, sizeof(ctx)); // get the config based on the configDir passed in - svn_config_get_config (&ctx.config, c_configDir, pool); + svn_config_get_config(&ctx.config, c_configDir, pool); // tell the auth functions where the config is svn_auth_set_parameter(ab, SVN_AUTH_PARAM_CONFIG_DIR, @@ -233,28 +233,28 @@ namespace svn void *param = 0; if (!value) param = (void *)"1"; - - svn_auth_set_parameter (ctx.auth_baton, - SVN_AUTH_PARAM_NO_AUTH_CACHE, - param); + + svn_auth_set_parameter(ctx.auth_baton, + SVN_AUTH_PARAM_NO_AUTH_CACHE, + param); } /** @see Context::setLogin */ - void setLogin (const char * usr, const char * pwd) + void setLogin(const char * usr, const char * pwd) { username = usr; password = pwd; svn_auth_baton_t * ab = ctx.auth_baton; - svn_auth_set_parameter (ab, SVN_AUTH_PARAM_DEFAULT_USERNAME, - username.c_str ()); - svn_auth_set_parameter (ab, SVN_AUTH_PARAM_DEFAULT_PASSWORD, - password.c_str ()); + svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_USERNAME, + username.c_str()); + svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_PASSWORD, + password.c_str()); } /** @see Context::setLogMessage */ - void setLogMessage (const char * msg) + void setLogMessage(const char * msg) { logMessage = msg; logIsSet = true; @@ -266,28 +266,28 @@ namespace svn * for example */ static svn_error_t * - onLogMsg (const char **log_msg, - const char **tmp_file, - apr_array_header_t *, //UNUSED commit_items - void *baton, - apr_pool_t * pool) + onLogMsg(const char **log_msg, + const char **tmp_file, + apr_array_header_t *, //UNUSED commit_items + void *baton, + apr_pool_t * pool) { Data * data = NULL; - SVN_ERR (getData (baton, &data)); + SVN_ERR(getData(baton, &data)); std::string msg; if (data->logIsSet) - msg = data->getLogMessage (); + msg = data->getLogMessage(); else { - if (!data->retrieveLogMessage (msg)) - return svn_error_create (SVN_ERR_CANCELLED, NULL, ""); + if (!data->retrieveLogMessage(msg)) + return svn_error_create(SVN_ERR_CANCELLED, NULL, ""); } - *log_msg = apr_pstrdup (pool, msg.c_str ()); + *log_msg = apr_pstrdup(pool, msg.c_str()); *tmp_file = NULL; - + return SVN_NO_ERROR; } @@ -295,23 +295,23 @@ namespace svn * this is the callback function for the subversion * api functions to signal the progress of an action */ - static void - onNotify (void * baton, - const char *path, - svn_wc_notify_action_t action, - svn_node_kind_t kind, - const char *mime_type, - svn_wc_notify_state_t content_state, - svn_wc_notify_state_t prop_state, - svn_revnum_t revision) + static void + onNotify(void * baton, + const char *path, + svn_wc_notify_action_t action, + svn_node_kind_t kind, + const char *mime_type, + svn_wc_notify_state_t content_state, + svn_wc_notify_state_t prop_state, + svn_revnum_t revision) { if (baton == 0) return; - Data * data = static_cast (baton); + Data * data = static_cast (baton); - data->notify (path, action, kind, mime_type, content_state, - prop_state, revision); + data->notify(path, action, kind, mime_type, content_state, + prop_state, revision); } @@ -319,22 +319,22 @@ namespace svn /** * this is the callback function for the subversion 1.2 * api functions to signal the progress of an action - * + * * @todo right now we forward only to @a onNotify, * but maybe we should a notify2 to the listener * @since subversion 1.2 */ static void - onNotify2 (void*baton,const svn_wc_notify_t *action,apr_pool_t *) + onNotify2(void*baton,const svn_wc_notify_t *action,apr_pool_t *) { if (!baton) return; - + // for now forward the call to @a onNotify - onNotify (baton, action->path, action->action, - action->kind, action->mime_type, - action->content_state, action->prop_state, - action->revision); + onNotify(baton, action->path, action->action, + action->kind, action->mime_type, + action->content_state, action->prop_state, + action->revision); } #endif @@ -343,16 +343,16 @@ namespace svn * this is the callback function for the subversion * api functions to signal the progress of an action */ - static svn_error_t * - onCancel (void * baton) + static svn_error_t * + onCancel(void * baton) { if (baton == 0) return SVN_NO_ERROR; - Data * data = static_cast (baton); + Data * data = static_cast (baton); - if (data->cancel ()) - return svn_error_create (SVN_ERR_CANCELLED, NULL, "cancelled by user"); + if (data->cancel()) + return svn_error_create(SVN_ERR_CANCELLED, NULL, "cancelled by user"); else return SVN_NO_ERROR; } @@ -361,30 +361,30 @@ namespace svn * @see svn_auth_simple_prompt_func_t */ static svn_error_t * - onSimplePrompt (svn_auth_cred_simple_t **cred, - void *baton, - const char *realm, - const char *username, - svn_boolean_t _may_save, - apr_pool_t *pool) + onSimplePrompt(svn_auth_cred_simple_t **cred, + void *baton, + const char *realm, + const char *username, + svn_boolean_t _may_save, + apr_pool_t *pool) { Data * data = NULL; - SVN_ERR (getData (baton, &data)); + SVN_ERR(getData(baton, &data)); bool may_save = _may_save != 0; - if (!data->retrieveLogin (username, realm, may_save )) - return svn_error_create (SVN_ERR_CANCELLED, NULL, ""); + if (!data->retrieveLogin(username, realm, may_save)) + return svn_error_create(SVN_ERR_CANCELLED, NULL, ""); svn_auth_cred_simple_t* lcred = (svn_auth_cred_simple_t*) - apr_palloc (pool, sizeof (svn_auth_cred_simple_t)); -/* SVN_ERR (svn_utf_cstring_to_utf8 ( - &lcred->password, - data->getPassword (), pool)); - SVN_ERR (svn_utf_cstring_to_utf8 ( - &lcred->username, - data->getUsername (), pool)); */ - lcred->password = data->getPassword (); - lcred->username = data->getUsername (); + apr_palloc(pool, sizeof(svn_auth_cred_simple_t)); + /* SVN_ERR (svn_utf_cstring_to_utf8 ( + &lcred->password, + data->getPassword (), pool)); + SVN_ERR (svn_utf_cstring_to_utf8 ( + &lcred->username, + data->getUsername (), pool)); */ + lcred->password = data->getPassword(); + lcred->username = data->getUsername(); // tell svn if the credentials need to be saved lcred->may_save = may_save; @@ -397,18 +397,18 @@ namespace svn * @see svn_auth_ssl_server_trust_prompt_func_t */ static svn_error_t * - onSslServerTrustPrompt (svn_auth_cred_ssl_server_trust_t **cred, - void *baton, - const char *realm, - apr_uint32_t failures, - const svn_auth_ssl_server_cert_info_t *info, - svn_boolean_t may_save, - apr_pool_t *pool) + onSslServerTrustPrompt(svn_auth_cred_ssl_server_trust_t **cred, + void *baton, + const char *realm, + apr_uint32_t failures, + const svn_auth_ssl_server_cert_info_t *info, + svn_boolean_t may_save, + apr_pool_t *pool) { Data * data = NULL; - SVN_ERR (getData (baton, &data)); - - ContextListener::SslServerTrustData trustData (failures); + SVN_ERR(getData(baton, &data)); + + ContextListener::SslServerTrustData trustData(failures); if (realm != NULL) trustData.realm = realm; trustData.hostname = info->hostname; @@ -420,17 +420,17 @@ namespace svn apr_uint32_t acceptedFailures; ContextListener::SslServerTrustAnswer answer = - data->listener->contextSslServerTrustPrompt ( - trustData, acceptedFailures ); + data->listener->contextSslServerTrustPrompt( + trustData, acceptedFailures); - if(answer == ContextListener::DONT_ACCEPT) + if (answer == ContextListener::DONT_ACCEPT) *cred = NULL; else { - svn_auth_cred_ssl_server_trust_t *cred_ = + svn_auth_cred_ssl_server_trust_t *cred_ = (svn_auth_cred_ssl_server_trust_t*) - apr_palloc (pool, sizeof (svn_auth_cred_ssl_server_trust_t)); - + apr_palloc(pool, sizeof(svn_auth_cred_ssl_server_trust_t)); + if (answer == ContextListener::ACCEPT_PERMANENTLY) { cred_->may_save = 1; @@ -438,7 +438,7 @@ namespace svn } *cred = cred_; } - + return SVN_NO_ERROR; } @@ -446,26 +446,26 @@ namespace svn * @see svn_auth_ssl_client_cert_prompt_func_t */ static svn_error_t * - onSslClientCertPrompt (svn_auth_cred_ssl_client_cert_t **cred, - void *baton, - apr_pool_t *pool) + onSslClientCertPrompt(svn_auth_cred_ssl_client_cert_t **cred, + void *baton, + apr_pool_t *pool) { Data * data = NULL; - SVN_ERR (getData (baton, &data)); + SVN_ERR(getData(baton, &data)); std::string certFile; - if (!data->listener->contextSslClientCertPrompt (certFile)) - return svn_error_create (SVN_ERR_CANCELLED, NULL, ""); + if (!data->listener->contextSslClientCertPrompt(certFile)) + return svn_error_create(SVN_ERR_CANCELLED, NULL, ""); - svn_auth_cred_ssl_client_cert_t *cred_ = + svn_auth_cred_ssl_client_cert_t *cred_ = (svn_auth_cred_ssl_client_cert_t*) - apr_palloc (pool, sizeof (svn_auth_cred_ssl_client_cert_t)); - -/* SVN_ERR (svn_utf_cstring_to_utf8 ( - &cred_->cert_file, - certFile.c_str (), - pool)); */ - cred_->cert_file = certFile.c_str (); + apr_palloc(pool, sizeof(svn_auth_cred_ssl_client_cert_t)); + + /* SVN_ERR (svn_utf_cstring_to_utf8 ( + &cred_->cert_file, + certFile.c_str (), + pool)); */ + cred_->cert_file = certFile.c_str(); *cred = cred_; @@ -473,61 +473,61 @@ namespace svn } /** - * @see svn_auth_ssl_client_cert_pw_prompt_func_t + * @see svn_auth_ssl_client_cert_pw_prompt_func_t */ static svn_error_t * - onSslClientCertPwPrompt ( - svn_auth_cred_ssl_client_cert_pw_t **cred, - void *baton, + onSslClientCertPwPrompt( + svn_auth_cred_ssl_client_cert_pw_t **cred, + void *baton, const char *realm, svn_boolean_t maySave, apr_pool_t *pool) { Data * data = NULL; - SVN_ERR (getData (baton, &data)); + SVN_ERR(getData(baton, &data)); std::string password; bool may_save = maySave != 0; - if (!data->listener->contextSslClientCertPwPrompt (password, realm, may_save)) - return svn_error_create (SVN_ERR_CANCELLED, NULL, ""); + if (!data->listener->contextSslClientCertPwPrompt(password, realm, may_save)) + return svn_error_create(SVN_ERR_CANCELLED, NULL, ""); - svn_auth_cred_ssl_client_cert_pw_t *cred_ = + svn_auth_cred_ssl_client_cert_pw_t *cred_ = (svn_auth_cred_ssl_client_cert_pw_t *) - apr_palloc (pool, sizeof (svn_auth_cred_ssl_client_cert_pw_t)); - -/* SVN_ERR (svn_utf_cstring_to_utf8 ( - &cred_->password, - password.c_str (), - pool)); */ - cred_->password = password.c_str (); - + apr_palloc(pool, sizeof(svn_auth_cred_ssl_client_cert_pw_t)); + + /* SVN_ERR (svn_utf_cstring_to_utf8 ( + &cred_->password, + password.c_str (), + pool)); */ + cred_->password = password.c_str(); + cred_->may_save = may_save; *cred = cred_; return SVN_NO_ERROR; } - const char * - getUsername () const + const char * + getUsername() const { - return username.c_str (); + return username.c_str(); } const char * - getPassword () const + getPassword() const { - return password.c_str (); + return password.c_str(); } const char * - getLogMessage () const + getLogMessage() const { - return logMessage.c_str (); + return logMessage.c_str(); } /** * if the @a listener is set, use it to retrieve the log - * message using ContextListener::contextGetLogMessage. + * message using ContextListener::contextGetLogMessage. * This return values is given back, then. * * if the @a listener is not set the its checked whether @@ -537,15 +537,15 @@ namespace svn * @param msg log message * @retval false cancel */ - bool - retrieveLogMessage (std::string & msg) + bool + retrieveLogMessage(std::string & msg) { bool ok; if (listener == 0) return false; - ok = listener->contextGetLogMessage (logMessage); + ok = listener->contextGetLogMessage(logMessage); if (ok) msg = logMessage; else @@ -556,19 +556,19 @@ namespace svn /** * if the @a listener is set and no password has been - * set yet, use it to retrieve login and password using + * set yet, use it to retrieve login and password using * ContextListener::contextGetLogin. - * + * * if the @a listener is not set, check if setLogin - * has been called yet. + * has been called yet. * * @return continue? * @retval false cancel */ bool - retrieveLogin (const char * username_, - const char * realm, - bool &may_save) + retrieveLogin(const char * username_, + const char * realm, + bool &may_save) { bool ok; @@ -580,7 +580,7 @@ namespace svn else username = username_; - ok = listener->contextGetLogin (realm, username, password, may_save); + ok = listener->contextGetLogin(realm, username, password, may_save); return ok; } @@ -589,19 +589,19 @@ namespace svn * if the @a listener is set call the method * @a contextNotify */ - void - notify (const char *path, - svn_wc_notify_action_t action, - svn_node_kind_t kind, - const char *mime_type, - svn_wc_notify_state_t content_state, - svn_wc_notify_state_t prop_state, - svn_revnum_t revision) + void + notify(const char *path, + svn_wc_notify_action_t action, + svn_node_kind_t kind, + const char *mime_type, + svn_wc_notify_state_t content_state, + svn_wc_notify_state_t prop_state, + svn_revnum_t revision) { if (listener != 0) { - listener->contextNotify (path, action, kind, mime_type, - content_state, prop_state, revision); + listener->contextNotify(path, action, kind, mime_type, + content_state, prop_state, revision); } } @@ -609,12 +609,12 @@ namespace svn * if the @a listener is set call the method * @a contextCancel */ - bool - cancel () + bool + cancel() { if (listener != 0) { - return listener->contextCancel (); + return listener->contextCancel(); } else { @@ -624,83 +624,83 @@ namespace svn } }; - Context::Context (const std::string &configDir) + Context::Context(const std::string &configDir) { - m = new Data (configDir); + m = new Data(configDir); } - Context::Context (const Context & src) + Context::Context(const Context & src) { - m = new Data (src.m->configDir); - setLogin (src.getUsername (), src.getPassword ()); + m = new Data(src.m->configDir); + setLogin(src.getUsername(), src.getPassword()); } - Context::~Context () + Context::~Context() { delete m; } - + void - Context::setAuthCache (bool value) + Context::setAuthCache(bool value) { - m->setAuthCache (value); + m->setAuthCache(value); } void - Context::setLogin (const char * username, const char * password) + Context::setLogin(const char * username, const char * password) { - m->setLogin (username, password); + m->setLogin(username, password); } - Context::operator svn_client_ctx_t * () + Context::operator svn_client_ctx_t * () { return &(m->ctx); } - svn_client_ctx_t * - Context::ctx () + svn_client_ctx_t * + Context::ctx() { return &(m->ctx); } - - void - Context::setLogMessage (const char * msg) + + void + Context::setLogMessage(const char * msg) { - m->setLogMessage (msg); + m->setLogMessage(msg); } const char * - Context::getUsername () const + Context::getUsername() const { - return m->getUsername (); + return m->getUsername(); } const char * - Context::getPassword () const + Context::getPassword() const { - return m->getPassword (); + return m->getPassword(); } const char * - Context::getLogMessage () const + Context::getLogMessage() const { - return m->getLogMessage (); + return m->getLogMessage(); } - void - Context::setListener (ContextListener * listener) + void + Context::setListener(ContextListener * listener) { m->listener = listener; } - ContextListener * - Context::getListener () const + ContextListener * + Context::getListener() const { return m->listener; } void - Context::reset () + Context::reset() { m->promptCounter = 0; m->logIsSet = false; diff --git a/src/svncpp/datetime.cpp b/src/svncpp/datetime.cpp index fa028f67..2befdaf3 100644 --- a/src/svncpp/datetime.cpp +++ b/src/svncpp/datetime.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -31,18 +31,18 @@ namespace svn { - DateTime::DateTime () - : m_time(APR_DATE_BAD) + DateTime::DateTime() + : m_time(APR_DATE_BAD) { } - DateTime::DateTime (const apr_time_t time) - : m_time(time) + DateTime::DateTime(const apr_time_t time) + : m_time(time) { } - DateTime::DateTime (const DateTime & dateTime) - : m_time(dateTime.m_time) + DateTime::DateTime(const DateTime & dateTime) + : m_time(dateTime.m_time) { } @@ -66,19 +66,19 @@ namespace svn } const bool - DateTime::IsValid () const + DateTime::IsValid() const { return m_time != APR_DATE_BAD; } const apr_time_t - DateTime::GetAPRTimeT () const + DateTime::GetAPRTimeT() const { return m_time; } const bool - DateTime::SetRFC822Date (const char* date) + DateTime::SetRFC822Date(const char* date) { m_time = apr_date_parse_rfc(date); return IsValid(); diff --git a/src/svncpp/dirent.cpp b/src/svncpp/dirent.cpp index 2d09d2fd..84b636ff 100644 --- a/src/svncpp/dirent.cpp +++ b/src/svncpp/dirent.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -32,7 +32,7 @@ namespace svn { struct DirEntry::Data { - public: +public: std::string name; svn_node_kind_t kind; svn_filesize_t size; @@ -41,98 +41,98 @@ namespace svn apr_time_t time; std::string lastAuthor; - Data () - : kind (svn_node_unknown), size (0), hasProps(false), - createdRev (0), time (0) + Data() + : kind(svn_node_unknown), size(0), hasProps(false), + createdRev(0), time(0) { } - Data (const char * _name, svn_dirent_t * dirEntry) - : name (_name), kind (dirEntry->kind), size (dirEntry->size), - hasProps (dirEntry->has_props != 0), - createdRev (dirEntry->created_rev), time (dirEntry->time) + Data(const char * _name, svn_dirent_t * dirEntry) + : name(_name), kind(dirEntry->kind), size(dirEntry->size), + hasProps(dirEntry->has_props != 0), + createdRev(dirEntry->created_rev), time(dirEntry->time) { lastAuthor = dirEntry->last_author == 0 ? "" : dirEntry->last_author; } - Data (const DirEntry & src) + Data(const DirEntry & src) { - init (src); + init(src); } void - init (const DirEntry & src) + init(const DirEntry & src) { - name = src.name (); - kind = src.kind (); - size = src.size (); - hasProps = src.hasProps (); - createdRev = src.createdRev (); - time = src.time (); - lastAuthor = src.lastAuthor (); + name = src.name(); + kind = src.kind(); + size = src.size(); + hasProps = src.hasProps(); + createdRev = src.createdRev(); + time = src.time(); + lastAuthor = src.lastAuthor(); } }; - DirEntry::DirEntry () - : m (new Data ()) + DirEntry::DirEntry() + : m(new Data()) { } - DirEntry::DirEntry (const char * name, svn_dirent_t * DirEntry) - : m (new Data (name, DirEntry)) + DirEntry::DirEntry(const char * name, svn_dirent_t * DirEntry) + : m(new Data(name, DirEntry)) { } - DirEntry::DirEntry (const DirEntry & src) - : m (new Data (src)) + DirEntry::DirEntry(const DirEntry & src) + : m(new Data(src)) { } - DirEntry::~DirEntry () + DirEntry::~DirEntry() { delete m; } svn_node_kind_t - DirEntry::kind () const + DirEntry::kind() const { return m->kind; } svn_filesize_t - DirEntry::size () const + DirEntry::size() const { return m->size; } bool - DirEntry::hasProps () const + DirEntry::hasProps() const { return m->hasProps; } svn_revnum_t - DirEntry::createdRev () const + DirEntry::createdRev() const { return m->createdRev; } apr_time_t - DirEntry::time () const + DirEntry::time() const { return m->time; } const char * - DirEntry::lastAuthor () const + DirEntry::lastAuthor() const { - return m->lastAuthor.c_str (); + return m->lastAuthor.c_str(); } const char * - DirEntry::name () const + DirEntry::name() const { - return m->name.c_str (); + return m->name.c_str(); } DirEntry & @@ -141,7 +141,7 @@ namespace svn if (this == &dirEntry) return *this; - m->init (dirEntry); + m->init(dirEntry); return *this; } } diff --git a/src/svncpp/entry.cpp b/src/svncpp/entry.cpp index a1850846..b3476399 100644 --- a/src/svncpp/entry.cpp +++ b/src/svncpp/entry.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -28,38 +28,38 @@ namespace svn { - Entry::Entry (const svn_wc_entry_t * src) - : m_entry (0), m_pool (0), m_valid (false) + Entry::Entry(const svn_wc_entry_t * src) + : m_entry(0), m_pool(0), m_valid(false) { - init (src); + init(src); } - Entry::Entry (const Entry & src) - : m_entry (0), m_pool (0), m_valid (false) + Entry::Entry(const Entry & src) + : m_entry(0), m_pool(0), m_valid(false) { - init (src); + init(src); } - Entry::~Entry () + Entry::~Entry() { // no need to explicitely de-allocate m_entry // since this will be handled by m_pool } void - Entry::init (const svn_wc_entry_t * src) + Entry::init(const svn_wc_entry_t * src) { if (src) { // copy the contents of src - m_entry = svn_wc_entry_dup (src, m_pool); + m_entry = svn_wc_entry_dup(src, m_pool); m_valid = true; } else { // create an empty entry m_entry = (svn_wc_entry_t*) - apr_pcalloc (m_pool, sizeof (svn_wc_entry_t)); + apr_pcalloc(m_pool, sizeof(svn_wc_entry_t)); } } @@ -69,7 +69,7 @@ namespace svn if (this == &src) return *this; - init (src); + init(src); return *this; } diff --git a/src/svncpp/exception.cpp b/src/svncpp/exception.cpp index 1eccf057..c1d3b22e 100644 --- a/src/svncpp/exception.cpp +++ b/src/svncpp/exception.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,52 +35,52 @@ namespace svn struct Exception::Data { - public: +public: std::string message; apr_status_t apr_err; - Data (const char * msg) - : message (msg) + Data(const char * msg) + : message(msg) { } - - - Data (const Data& other) - : message(other.message), apr_err(other.apr_err) + + + Data(const Data& other) + : message(other.message), apr_err(other.apr_err) { } }; - - Exception::Exception (const char * message) throw () + + Exception::Exception(const char * message) throw() { - m = new Data (message); + m = new Data(message); } - Exception::Exception (const Exception & other) throw () + Exception::Exception(const Exception & other) throw() { - m = new Data (*other.m); + m = new Data(*other.m); } - Exception::~Exception () throw () + Exception::~Exception() throw() { delete m; } const apr_status_t - Exception::apr_err () const + Exception::apr_err() const { return m->apr_err; } const char * - Exception::message () const + Exception::message() const { - return m->message.c_str (); + return m->message.c_str(); } - ClientException::ClientException (svn_error_t * error) throw () - : Exception ("") + ClientException::ClientException(svn_error_t * error) throw() + : Exception("") { if (error == 0) return; @@ -89,12 +89,12 @@ namespace svn svn_error_t * next = error->child; /// @todo send rapidsvn an hint that error->message may sometimes NULL! std::string & message = m->message; - if (error->message) + if (error->message) message = error->message; - else + else { message = "Unknown error!\n"; - if (error->file) + if (error->file) { message += "In file "; message += error->file; @@ -109,23 +109,23 @@ namespace svn next = next->child; } - svn_error_clear (error); + svn_error_clear(error); } - ClientException::ClientException (apr_status_t status) throw () - : Exception ("") + ClientException::ClientException(apr_status_t status) throw() + : Exception("") { m->apr_err = status; } - ClientException::~ClientException () throw () + ClientException::~ClientException() throw() { } - ClientException::ClientException (const ClientException & src) throw () - : Exception (src.message ()) + ClientException::ClientException(const ClientException & src) throw() + : Exception(src.message()) { } } diff --git a/src/svncpp/info.cpp b/src/svncpp/info.cpp index 59b2e3ae..97b103c0 100644 --- a/src/svncpp/info.cpp +++ b/src/svncpp/info.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,35 +34,35 @@ namespace svn svn_info_t * info; Path path; Pool pool; - + /** constructor (because of optional param */ - Data (const Path & path_, const svn_info_t * info_ = 0) - : info (0), path (path_) + Data(const Path & path_, const svn_info_t * info_ = 0) + : info(0), path(path_) { if (info_ != 0) - info = svn_info_dup (info_, pool); + info = svn_info_dup(info_, pool); } - + /** copy constructor */ - Data (const Data * src) - : info (0), path (src->path) + Data(const Data * src) + : info(0), path(src->path) { if (src->info != 0) - info = svn_info_dup (src->info, pool); + info = svn_info_dup(src->info, pool); } }; - - Info::Info (const Path & path, const svn_info_t * info) - : m (new Data (path, info)) + + Info::Info(const Path & path, const svn_info_t * info) + : m(new Data(path, info)) { } - Info::Info (const Info & src) - : m (new Data (src.m)) + Info::Info(const Info & src) + : m(new Data(src.m)) { } - Info::~Info () + Info::~Info() { delete m; } @@ -74,7 +74,7 @@ namespace svn if (this != &src) { delete m; - m = new Data (src.m); + m = new Data(src.m); } return *this; @@ -82,7 +82,7 @@ namespace svn const svn_node_kind_t Info:: - kind () const + kind() const { if (0 == m->info) return svn_node_none; @@ -90,15 +90,15 @@ namespace svn return m->info->kind; } - bool - Info::isValid () const + bool + Info::isValid() const { return m->info != 0; } - const char * - Info::url () const + const char * + Info::url() const { if (0 == m->info) return 0; diff --git a/src/svncpp/log_entry.cpp b/src/svncpp/log_entry.cpp index 2d94e6f3..ee634880 100644 --- a/src/svncpp/log_entry.cpp +++ b/src/svncpp/log_entry.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,24 +35,24 @@ namespace svn { - LogChangePathEntry::LogChangePathEntry ( + LogChangePathEntry::LogChangePathEntry( const char *path_, char action_, const char *copyFromPath_, const svn_revnum_t copyFromRevision_) - : path (path_), action(action_), - copyFromPath (copyFromPath_ != NULL ? copyFromPath_ : ""), - copyFromRevision (copyFromRevision_) + : path(path_), action(action_), + copyFromPath(copyFromPath_ != NULL ? copyFromPath_ : ""), + copyFromRevision(copyFromRevision_) { } - LogEntry::LogEntry () + LogEntry::LogEntry() { } - LogEntry::LogEntry ( + LogEntry::LogEntry( const svn_revnum_t revision_, const char * author_, const char * date_, @@ -64,7 +64,7 @@ namespace svn { Pool pool; - if (svn_time_from_cstring (&date, date_, pool) != 0) + if (svn_time_from_cstring(&date, date_, pool) != 0) date = 0; } diff --git a/src/svncpp/m_check.hpp b/src/svncpp/m_check.hpp index 0f3c95d3..933e4b73 100644 --- a/src/svncpp/m_check.hpp +++ b/src/svncpp/m_check.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many diff --git a/src/svncpp/path.cpp b/src/svncpp/path.cpp index 8728b264..c0ab8fae 100644 --- a/src/svncpp/path.cpp +++ b/src/svncpp/path.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -28,30 +28,30 @@ // apr api #include "apr_file_io.h" -// svncpp +// svncpp #include "svncpp/path.hpp" #include "svncpp/pool.hpp" #include "svncpp/url.hpp" namespace svn { - Path::Path (const char * path) + Path::Path(const char * path) { - init (path); + init(path); } - Path::Path (const std::string & path) + Path::Path(const std::string & path) { - init (path.c_str ()); + init(path.c_str()); } - Path::Path (const Path & path) + Path::Path(const Path & path) { - init (path.c_str ()); + init(path.c_str()); } void - Path::init (const char * path) + Path::init(const char * path) { Pool pool; @@ -61,38 +61,38 @@ namespace svn m_path = ""; else { - const char * int_path = - svn_path_internal_style (path, pool.pool () ); - + const char * int_path = + svn_path_internal_style(path, pool.pool()); + m_path = int_path; - - if (svn::Url::isValid (int_path)) + + if (svn::Url::isValid(int_path)) { m_pathIsUrl = true; - m_path = svn::Url::escape (int_path); + m_path = svn::Url::escape(int_path); } } } const std::string & - Path::path () const + Path::path() const { return m_path; } - const char * + const char * Path::c_str() const { - return m_path.c_str (); + return m_path.c_str(); } - Path& + Path& Path::operator= (const Path & path) { if (this == &path) return *this; - init (path.c_str ()); + init(path.c_str()); return *this; } @@ -100,33 +100,33 @@ namespace svn bool Path::operator== (const Path& path) const { - if (path.path () == this->path ()) + if (path.path() == this->path()) return true; return false; } bool - Path::isset () const + Path::isset() const { - return m_path.length () > 0; + return m_path.length() > 0; } const bool - Path::isUrl () const + Path::isUrl() const { return m_pathIsUrl; } - static bool - isAbsolute (const char * path) + static bool + isAbsolute(const char * path) { if (0 == path) return false; - std::string p (path); + std::string p(path); - if (0 == p.length ()) + if (0 == p.length()) return false; // a path that begins with "/" is absolute @@ -135,7 +135,7 @@ namespace svn // a path with a ":" like "http://xxx" or // "c:/foo" is absolute too - if (p.find (":", 0) != std::string::npos) + if (p.find(":", 0) != std::string::npos) return true; // Well it's relative @@ -143,7 +143,7 @@ namespace svn } void - Path::addComponent (const char * component) + Path::addComponent(const char * component) { Pool pool; @@ -156,62 +156,62 @@ namespace svn // if the @a component is absolute, simply // use it - if (isAbsolute (component)) + if (isAbsolute(component)) { m_path = component; return; } - if (Url::isValid (m_path.c_str ())) + if (Url::isValid(m_path.c_str())) { const char * newPath = - svn_path_url_add_component (m_path.c_str (), - component, - pool); + svn_path_url_add_component(m_path.c_str(), + component, + pool); m_path = newPath; } else { - svn_stringbuf_t * pathStringbuf = - svn_stringbuf_create (m_path.c_str (), pool); + svn_stringbuf_t * pathStringbuf = + svn_stringbuf_create(m_path.c_str(), pool); - svn_path_add_component (pathStringbuf, - component); + svn_path_add_component(pathStringbuf, + component); m_path = pathStringbuf->data; } } - void - Path::addComponent (const std::string & component) + void + Path::addComponent(const std::string & component) { - addComponent (component.c_str ()); + addComponent(component.c_str()); } void - Path::split (std::string & dirpath, std::string & basename) const + Path::split(std::string & dirpath, std::string & basename) const { Pool pool; const char * cdirpath; const char * cbasename; - svn_path_split (m_path.c_str (), &cdirpath, &cbasename, pool); + svn_path_split(m_path.c_str(), &cdirpath, &cbasename, pool); dirpath = cdirpath; basename = cbasename; } void - Path::split (std::string & dir, std::string & filename, std::string & ext) const + Path::split(std::string & dir, std::string & filename, std::string & ext) const { std::string basename; // first split path into dir and filename+ext - split (dir, basename); + split(dir, basename); // next search for last . - size_t pos = basename.find_last_of ("."); + size_t pos = basename.find_last_of("."); if (pos == std::string::npos) { filename = basename; @@ -219,46 +219,46 @@ namespace svn } else { - filename = basename.substr (0, pos); - ext = basename.substr (pos); + filename = basename.substr(0, pos); + ext = basename.substr(pos); } } std::string - Path::basename () const + Path::basename() const { std::string dir; std::string filename; - split (dir, filename); + split(dir, filename); return filename; } std::string - Path::dirpath () const + Path::dirpath() const { std::string dir; std::string filename; - split (dir, filename); + split(dir, filename); return dir; } std::string - Path::substr (const size_t count) const + Path::substr(const size_t count) const { - if (m_path.length () > count) - return m_path.substr (count); + if (m_path.length() > count) + return m_path.substr(count); else return ""; } std::string - Path::unescape () const + Path::unescape() const { - return svn::Url::unescape (m_path.c_str ()); + return svn::Url::unescape(m_path.c_str()); } /* =================================================================== @@ -273,26 +273,26 @@ namespace svn #define test_tempdir Fixed_test_tempdir #define apr_temp_dir_get Fixed_apr_temp_dir_get - + static char global_temp_dir[APR_PATH_MAX+1] = { 0 }; - + /* Try to open a temporary file in the temporary dir, write to it, and then close it. */ static int Fixed_test_tempdir(const char *temp_dir, apr_pool_t *p) { - apr_file_t *dummy_file; - // This is the only actual fix - adding the ".XXXXXX"! - const char *path = apr_pstrcat(p, temp_dir, "/apr-tmp.XXXXXX", NULL); - - if (apr_file_mktemp(&dummy_file, (char *)path, 0, p) == APR_SUCCESS) { - if (apr_file_putc('!', dummy_file) == APR_SUCCESS) { - if (apr_file_close(dummy_file) == APR_SUCCESS) { - apr_file_remove(path, p); - return 1; - } - } + apr_file_t *dummy_file; + // This is the only actual fix - adding the ".XXXXXX"! + const char *path = apr_pstrcat(p, temp_dir, "/apr-tmp.XXXXXX", NULL); + + if (apr_file_mktemp(&dummy_file, (char *)path, 0, p) == APR_SUCCESS) { + if (apr_file_putc('!', dummy_file) == APR_SUCCESS) { + if (apr_file_close(dummy_file) == APR_SUCCESS) { + apr_file_remove(path, p); + return 1; + } } - return 0; + } + return 0; } static apr_status_t Fixed_apr_temp_dir_get(const char **temp_dir, apr_pool_t *p) @@ -314,58 +314,58 @@ namespace svn "/tmp" "/var/tmp" "/usr/tmp" - `pwd` + `pwd` NOTE: This algorithm is basically the same one used by Python 2.2's tempfile.py module. */ /* Try the environment first. */ for (i = 0; i < (sizeof(try_envs) / sizeof(const char *)); i++) { - char *value; - apr_err = apr_env_get(&value, try_envs[i], p); - if ((apr_err == APR_SUCCESS) && value) { - apr_size_t len = strlen(value); - if (len && (len < APR_PATH_MAX) && test_tempdir(value, p)) { - memcpy(global_temp_dir, value, len + 1); - goto end; - } + char *value; + apr_err = apr_env_get(&value, try_envs[i], p); + if ((apr_err == APR_SUCCESS) && value) { + apr_size_t len = strlen(value); + if (len && (len < APR_PATH_MAX) && test_tempdir(value, p)) { + memcpy(global_temp_dir, value, len + 1); + goto end; } + } } /* Next, try a set of hard-coded paths. */ for (i = 0; i < (sizeof(try_dirs) / sizeof(const char *)); i++) { - if (test_tempdir(try_dirs[i], p)) { - memcpy(global_temp_dir, try_dirs[i], strlen(try_dirs[i]) + 1); - goto end; - } + if (test_tempdir(try_dirs[i], p)) { + memcpy(global_temp_dir, try_dirs[i], strlen(try_dirs[i]) + 1); + goto end; + } } /* Finally, try the current working directory. */ if (APR_SUCCESS == apr_filepath_get(&cwd, APR_FILEPATH_NATIVE, p)) { - if (test_tempdir(cwd, p)) { - memcpy(global_temp_dir, cwd, strlen(cwd) + 1); - goto end; - } + if (test_tempdir(cwd, p)) { + memcpy(global_temp_dir, cwd, strlen(cwd) + 1); + goto end; + } } end: if (global_temp_dir[0]) { - *temp_dir = apr_pstrdup(p, global_temp_dir); - return APR_SUCCESS; + *temp_dir = apr_pstrdup(p, global_temp_dir); + return APR_SUCCESS; } return APR_EGENERAL; } /* =================================================================== * End of inserted fixed APR code */ - + Path - Path::getTempDir () + Path::getTempDir() { const char * tempdir = NULL; Pool pool; - if (apr_temp_dir_get (&tempdir, pool) != APR_SUCCESS) + if (apr_temp_dir_get(&tempdir, pool) != APR_SUCCESS) { tempdir = NULL; } @@ -373,29 +373,29 @@ namespace svn return tempdir; } - size_t - Path::length () const + size_t + Path::length() const { - return m_path.length (); + return m_path.length(); } std::string - Path::native () const + Path::native() const { Pool pool; if (m_pathIsUrl) { // this converts something like - // http://foo/my%20location - // to + // http://foo/my%20location + // to // http://foo/my location - return svn_path_uri_decode (m_path.c_str (), pool); + return svn_path_uri_decode(m_path.c_str(), pool); } else { // On Windows, p://foo/bar will be converted to p:\foo\bar - return svn_path_local_style (m_path.c_str (), pool); + return svn_path_local_style(m_path.c_str(), pool); } } } diff --git a/src/svncpp/pool.cpp b/src/svncpp/pool.cpp index aeec7ef5..d6918b8c 100644 --- a/src/svncpp/pool.cpp +++ b/src/svncpp/pool.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -33,53 +33,53 @@ namespace svn { static bool m_initialized = false; - inline static apr_pool_t * - pool_create (apr_pool_t * parent) + inline static apr_pool_t * + pool_create(apr_pool_t * parent) { // CAUTION: this is not thread-safe!!! if (!m_initialized) { m_initialized = true; - apr_pool_initialize (); + apr_pool_initialize(); } - return svn_pool_create (parent); + return svn_pool_create(parent); } - Pool::Pool (apr_pool_t * parent) - : m_parent (parent), m_pool (pool_create (parent)) + Pool::Pool(apr_pool_t * parent) + : m_parent(parent), m_pool(pool_create(parent)) { } - Pool::~Pool () + Pool::~Pool() { - if(m_pool) + if (m_pool) { - svn_pool_destroy (m_pool); + svn_pool_destroy(m_pool); } } apr_pool_t * - Pool::pool () const + Pool::pool() const { return m_pool; } void - Pool::renew () + Pool::renew() { if (m_pool) { - svn_pool_destroy (m_pool); + svn_pool_destroy(m_pool); } - m_pool = pool_create (m_parent); + m_pool = pool_create(m_parent); } //TODO // apr_pool_t * // Pool::operator=(const Pool & pool) // { -// return +// return // if (this == &path) // return *this; // m_path = path.c_str(); diff --git a/src/svncpp/property.cpp b/src/svncpp/property.cpp index 41941d04..0e4d9aa1 100644 --- a/src/svncpp/property.cpp +++ b/src/svncpp/property.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,81 +36,81 @@ namespace svn { - PropertyEntry::PropertyEntry (const char * name, const char * value) + PropertyEntry::PropertyEntry(const char * name, const char * value) { this->name = name; this->value = value; } - Property::Property (Context * context, const Path & path) - : m_context (context), m_path (path) + Property::Property(Context * context, const Path & path) + : m_context(context), m_path(path) { - list (); + list(); } - Property::~Property () + Property::~Property() { } void - Property::list () + Property::list() { Pool pool; Revision revision; - m_entries.clear (); + m_entries.clear(); apr_array_header_t * props; svn_error_t * error = - svn_client_proplist (&props, - m_path.c_str (), - revision, - false, /* recurse */ - *m_context, - pool); - if(error != NULL) + svn_client_proplist(&props, + m_path.c_str(), + revision, + false, /* recurse */ + *m_context, + pool); + if (error != NULL) { - throw ClientException (error); + throw ClientException(error); } for (int j = 0; j < props->nelts; ++j) { - svn_client_proplist_item_t *item = + svn_client_proplist_item_t *item = ((svn_client_proplist_item_t **)props->elts)[j]; apr_hash_index_t *hi; - for (hi = apr_hash_first (pool, item->prop_hash); hi; - hi = apr_hash_next (hi)) + for (hi = apr_hash_first(pool, item->prop_hash); hi; + hi = apr_hash_next(hi)) { const void *key; void *val; - apr_hash_this (hi, &key, NULL, &val); + apr_hash_this(hi, &key, NULL, &val); - m_entries.push_back (PropertyEntry ( - (const char *)key, getValue ((const char *)key).c_str ())); - } + m_entries.push_back(PropertyEntry( + (const char *)key, getValue((const char *)key).c_str())); + } } } - std::string - Property::getValue (const char * name) + std::string + Property::getValue(const char * name) { Pool pool; Revision revision; apr_hash_t *props; - svn_client_propget (&props, - name, - m_path.c_str (), - revision, - false, // recurse - *m_context, - pool); + svn_client_propget(&props, + name, + m_path.c_str(), + revision, + false, // recurse + *m_context, + pool); apr_hash_index_t *hi; - hi = apr_hash_first (pool, props); - if( !hi ) + hi = apr_hash_first(pool, props); + if (!hi) { return ""; } @@ -118,49 +118,49 @@ namespace svn const void *key; void *val; const svn_string_t *propval; - apr_hash_this (hi, &key, NULL, &val); + apr_hash_this(hi, &key, NULL, &val); propval = (const svn_string_t *)val; return propval->data; } void - Property::set (const char * name, const char * value) + Property::set(const char * name, const char * value) { Pool pool; const svn_string_t * propval = - svn_string_create ((const char *) value, pool); + svn_string_create((const char *) value, pool); bool recurse = false; bool skip_checks = false; - svn_error_t * error = - svn_client_propset2 (name, - propval, - m_path.c_str (), - recurse, - skip_checks, - *m_context, - pool); - - if(error != NULL) - throw ClientException (error); + svn_error_t * error = + svn_client_propset2(name, + propval, + m_path.c_str(), + recurse, + skip_checks, + *m_context, + pool); + + if (error != NULL) + throw ClientException(error); } - void - Property::remove (const char * name) + void + Property::remove(const char * name) { Pool pool; - svn_error_t * error = - svn_client_propset (name, - NULL, // value = NULL - m_path.c_str (), - false, //dont recurse - pool); - if(error != NULL) - throw ClientException (error); + svn_error_t * error = + svn_client_propset(name, + NULL, // value = NULL + m_path.c_str(), + false, //dont recurse + pool); + if (error != NULL) + throw ClientException(error); } } diff --git a/src/svncpp/revision.cpp b/src/svncpp/revision.cpp index 27c35b71..35c749b0 100644 --- a/src/svncpp/revision.cpp +++ b/src/svncpp/revision.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -28,45 +28,45 @@ namespace svn { - const Revision Revision::START (svn_opt_revision_number); - const Revision Revision::BASE (svn_opt_revision_base); - const Revision Revision::HEAD (svn_opt_revision_head); - const Revision Revision::WORKING (svn_opt_revision_working); - const Revision Revision::UNSPECIFIED (svn_opt_revision_unspecified); + const Revision Revision::START(svn_opt_revision_number); + const Revision Revision::BASE(svn_opt_revision_base); + const Revision Revision::HEAD(svn_opt_revision_head); + const Revision Revision::WORKING(svn_opt_revision_working); + const Revision Revision::UNSPECIFIED(svn_opt_revision_unspecified); - Revision::Revision (const svn_opt_revision_t * revision) + Revision::Revision(const svn_opt_revision_t * revision) { - init (revision); + init(revision); } - Revision::Revision (const svn_revnum_t revnum) + Revision::Revision(const svn_revnum_t revnum) { m_revision.kind = svn_opt_revision_number; m_revision.value.number = revnum; } - Revision::Revision (const svn_opt_revision_kind kind) + Revision::Revision(const svn_opt_revision_kind kind) { m_revision.kind = kind; m_revision.value.number = 0; } - Revision::Revision (const DateTime dateTime) + Revision::Revision(const DateTime dateTime) { m_revision.kind = svn_opt_revision_date; m_revision.value.date = dateTime.GetAPRTimeT(); } - Revision::Revision (const Revision & revision) + Revision::Revision(const Revision & revision) { - init (revision.revision ()); + init(revision.revision()); } void - Revision::init (const svn_opt_revision_t * revision) + Revision::init(const svn_opt_revision_t * revision) { - if( !revision ) + if (!revision) { m_revision.kind = svn_opt_revision_unspecified; } @@ -78,7 +78,7 @@ namespace svn // allowed to set number if we want to use date // and vice versa - switch( revision->kind ) + switch (revision->kind) { case svn_opt_revision_number: m_revision.value.number = revision->value.number; @@ -95,25 +95,25 @@ namespace svn } const svn_opt_revision_t * - Revision::revision () const + Revision::revision() const { return &m_revision; } const svn_revnum_t - Revision::revnum () const + Revision::revnum() const { return m_revision.value.number; } const apr_time_t - Revision::date () const + Revision::date() const { return m_revision.value.date; } const svn_opt_revision_kind - Revision::kind () const + Revision::kind() const { return m_revision.kind; } diff --git a/src/svncpp/status.cpp b/src/svncpp/status.cpp index 5ca7ba3a..47b39e06 100644 --- a/src/svncpp/status.cpp +++ b/src/svncpp/status.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,26 +37,26 @@ namespace svn Pool pool; bool isVersioned; - Data (const char * path_, const svn_wc_status2_t * status_) - : status (0), path ("") + Data(const char * path_, const svn_wc_status2_t * status_) + : status(0), path("") { if (path_ != 0) path = path_; if (status_ != 0) { - status = svn_wc_dup_status2 ( - const_cast (status_), pool); + status = svn_wc_dup_status2( + const_cast(status_), pool); isVersioned = status_->text_status > svn_wc_status_unversioned; } } - Data (const Data * src) - : status (0), path (src->path) + Data(const Data * src) + : status(0), path(src->path) { if (src->status != 0) { - status = svn_wc_dup_status2 (src->status, pool); + status = svn_wc_dup_status2(src->status, pool); switch (status->text_status) { @@ -75,80 +75,80 @@ namespace svn }; - Status::Status (const char * path, const svn_wc_status2_t * status) - : m (new Data (path, status)) + Status::Status(const char * path, const svn_wc_status2_t * status) + : m(new Data(path, status)) { } - Status::Status (const Status & src) - : m (new Data (src.m)) + Status::Status(const Status & src) + : m(new Data(src.m)) { } - Status::~Status () + Status::~Status() { delete m; } const char * - Status::path () const + Status::path() const { - return m->path.c_str (); + return m->path.c_str(); } - const Entry - Status::entry () const + const Entry + Status::entry() const { if (0 == m->status) - return Entry (); + return Entry(); - return Entry (m->status->entry); + return Entry(m->status->entry); } - const svn_wc_status_kind - Status::textStatus () const + const svn_wc_status_kind + Status::textStatus() const { return m->status->text_status; } - const svn_wc_status_kind - Status::propStatus () const + const svn_wc_status_kind + Status::propStatus() const { return m->status->prop_status; } - const bool - Status::isVersioned () const + const bool + Status::isVersioned() const { return m->isVersioned; } - const bool - Status::isCopied () const + const bool + Status::isCopied() const { return m->status->copied != 0; } const bool - Status::isSwitched () const + Status::isSwitched() const { return m->status->switched != 0; } const svn_wc_status_kind - Status::reposTextStatus () const + Status::reposTextStatus() const { return m->status->repos_text_status; } const svn_wc_status_kind - Status::reposPropStatus () const + Status::reposPropStatus() const { return m->status->repos_prop_status; } const bool - Status::isLocked () const + Status::isLocked() const { if (m->status->repos_lock && (m->status->repos_lock->token != 0)) return true; @@ -159,7 +159,7 @@ namespace svn } const bool - Status::isRepLock () const + Status::isRepLock() const { if (m->status->entry && (m->status->entry->lock_token != 0)) return false; @@ -170,7 +170,7 @@ namespace svn } const char * - Status::lockToken () const + Status::lockToken() const { if (m->status->repos_lock && m->status->repos_lock->token != 0) return m->status->repos_lock->token; @@ -181,7 +181,7 @@ namespace svn } const char * - Status::lockOwner () const + Status::lockOwner() const { if (m->status->repos_lock && m->status->repos_lock->token != 0) return m->status->repos_lock->owner; @@ -192,7 +192,7 @@ namespace svn } const char * - Status::lockComment () const + Status::lockComment() const { if (m->status->repos_lock && m->status->repos_lock->token != 0) return m->status->repos_lock->comment; @@ -203,7 +203,7 @@ namespace svn } const apr_time_t - Status::lockCreationDate () const + Status::lockCreationDate() const { if (m->status->repos_lock && m->status->repos_lock->token != 0) return m->status->repos_lock->creation_date; @@ -219,16 +219,16 @@ namespace svn if (this != &src) { delete m; - m = new Data (src.m); + m = new Data(src.m); } return *this; } bool - Status::isset () const + Status::isset() const { - return m->path.length () > 0; + return m->path.length() > 0; } } /* ----------------------------------------------------------------- diff --git a/src/svncpp/status_selection.cpp b/src/svncpp/status_selection.cpp index 407a2a61..fe990843 100644 --- a/src/svncpp/status_selection.cpp +++ b/src/svncpp/status_selection.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -44,7 +44,7 @@ namespace svn { - struct StatusSel::Data + struct StatusSel::Data { Targets targets; std::vector status; @@ -59,35 +59,35 @@ namespace svn Path emptyTarget; /** default constructor */ - Data () {} + Data() {} /** copy constructor */ - Data (const Data & src) + Data(const Data & src) { if (this != &src) - assign (src); + assign(src); } /** assign new values */ - void - assign (const Data & src) + void + assign(const Data & src) { // clear existing... - clear (); + clear(); // ... and set from source std::vector ::const_iterator it; - for(it = src.status.begin (); it != src.status.end (); it++) + for (it = src.status.begin(); it != src.status.end(); it++) { - push_back (*it); + push_back(*it); } } void - clear () + clear() { - targets.clear (); - status.clear (); + targets.clear(); + status.clear(); hasDirs = false; hasFiles = false; @@ -98,21 +98,21 @@ namespace svn } void - push_back (const Status & status_) + push_back(const Status & status_) { // skip pseudo entries - if (!status_.isset ()) + if (!status_.isset()) return; - if (!status_.isVersioned ()) + if (!status_.isVersioned()) { // for an unversioned entry we do not know // whether it's a file or a directory so // we have to check using APR apr_finfo_t finfo; Pool pool; - apr_status_t apr_status = apr_stat ( - &finfo, status_.path (), APR_FINFO_TYPE, pool); + apr_status_t apr_status = apr_stat( + &finfo, status_.path(), APR_FINFO_TYPE, pool); // if we get an error the file might // have been deleted in the meantime @@ -131,12 +131,12 @@ namespace svn else { hasVersioned = true; - if (Url::isValid (status_.path ())) + if (Url::isValid(status_.path())) hasUrl = true; else hasLocal = true; - if (svn_node_dir == status_.entry ().kind ()) + if (svn_node_dir == status_.entry().kind()) hasDirs = true; else hasFiles = true; @@ -144,23 +144,23 @@ namespace svn // add stuff only now (because of possible apr_error // which causes the function to exit) - targets.push_back (status_.path ()); - status.push_back (status_); + targets.push_back(status_.path()); + status.push_back(status_); } }; - StatusSel::StatusSel () - : m (new Data) + StatusSel::StatusSel() + : m(new Data) { } - StatusSel::StatusSel (const StatusSel & src) - : m (new Data) + StatusSel::StatusSel(const StatusSel & src) + : m(new Data) { // different instance? if (this != &src) - m->assign (*src.m); + m->assign(*src.m); } StatusSel & @@ -169,52 +169,52 @@ namespace svn if (this != &src) { delete m; - m = new Data (*src.m); + m = new Data(*src.m); } return *this; } - - StatusSel::~StatusSel () + + StatusSel::~StatusSel() { delete m; } const apr_array_header_t * - StatusSel::array (const Pool & pool) const + StatusSel::array(const Pool & pool) const { - return m->targets.array (pool); + return m->targets.array(pool); } - + const Targets & - StatusSel::targets () const + StatusSel::targets() const { return m->targets; } - size_t - StatusSel::size () const + size_t + StatusSel::size() const { - return m->targets.size (); + return m->targets.size(); } void - StatusSel::push_back (const Status & status) + StatusSel::push_back(const Status & status) { - m->push_back (status); + m->push_back(status); } void - StatusSel::clear () + StatusSel::clear() { - m->clear (); + m->clear(); } void - StatusSel::reserve (size_t size) + StatusSel::reserve(size_t size) { - m->targets.reserve (size); - m->status.reserve (size); + m->targets.reserve(size); + m->status.reserve(size); } StatusSel::operator const std::vector & () const @@ -223,46 +223,46 @@ namespace svn } const Path & - StatusSel::target () const + StatusSel::target() const { - if (size () > 0) - return m->targets.targets () [0]; + if (size() > 0) + return m->targets.targets()[0]; else return m->emptyTarget; } - bool - StatusSel::hasDirs () const + bool + StatusSel::hasDirs() const { return m->hasDirs; } bool - StatusSel::hasFiles () const + StatusSel::hasFiles() const { return m->hasFiles; } - bool - StatusSel::hasVersioned () const + bool + StatusSel::hasVersioned() const { return m->hasVersioned; } bool - StatusSel::hasUnversioned () const + StatusSel::hasUnversioned() const { return m->hasUnversioned; } bool - StatusSel::hasLocal () const + StatusSel::hasLocal() const { return m->hasLocal; } bool - StatusSel::hasUrl () const + StatusSel::hasUrl() const { return m->hasUrl; } diff --git a/src/svncpp/targets.cpp b/src/svncpp/targets.cpp index 2756b9d6..68f92a50 100644 --- a/src/svncpp/targets.cpp +++ b/src/svncpp/targets.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,83 +39,83 @@ namespace svn { - Targets::Targets (const std::vector & targets) + Targets::Targets(const std::vector & targets) { m_targets = targets; } - - Targets::Targets (const apr_array_header_t * apr_targets) + + Targets::Targets(const apr_array_header_t * apr_targets) { int i; - - m_targets.clear (); - m_targets.reserve (apr_targets->nelts); - + + m_targets.clear(); + m_targets.reserve(apr_targets->nelts); + for (i = 0; i < apr_targets->nelts; i++) { - const char ** target = - &APR_ARRAY_IDX (apr_targets, i, const char *); - - m_targets.push_back (Path (*target)); + const char ** target = + &APR_ARRAY_IDX(apr_targets, i, const char *); + + m_targets.push_back(Path(*target)); } } - - Targets::Targets (const Targets & targets) + + Targets::Targets(const Targets & targets) { - m_targets = targets.targets (); + m_targets = targets.targets(); } - - Targets::Targets (const char * target) + + Targets::Targets(const char * target) { if (target != 0) { - m_targets.push_back (target); + m_targets.push_back(target); } } - Targets::~Targets () + Targets::~Targets() { } const apr_array_header_t * - Targets::array (const Pool & pool) const + Targets::array(const Pool & pool) const { std::vector::const_iterator it; - - apr_pool_t *apr_pool = pool.pool (); - apr_array_header_t *apr_targets = - apr_array_make (apr_pool, - m_targets.size(), - sizeof (const char *)); - - for (it = m_targets.begin (); it != m_targets.end (); it++) + + apr_pool_t *apr_pool = pool.pool(); + apr_array_header_t *apr_targets = + apr_array_make(apr_pool, + m_targets.size(), + sizeof(const char *)); + + for (it = m_targets.begin(); it != m_targets.end(); it++) { const Path &path = *it; const char * target = - apr_pstrdup (apr_pool, path.c_str()); - - (*((const char **) apr_array_push (apr_targets))) = target; + apr_pstrdup(apr_pool, path.c_str()); + + (*((const char **) apr_array_push(apr_targets))) = target; } - + return apr_targets; } - + const std::vector & - Targets::targets () const + Targets::targets() const { return m_targets; } - size_t - Targets::size () const + size_t + Targets::size() const { - return m_targets.size (); + return m_targets.size(); } const Path - Targets::target () const + Targets::target() const { - if (m_targets.size () > 0) + if (m_targets.size() > 0) { return m_targets[0]; } @@ -126,21 +126,21 @@ namespace svn } void - Targets::push_back (const Path & path) + Targets::push_back(const Path & path) { - m_targets.push_back (path); + m_targets.push_back(path); } void - Targets::clear () + Targets::clear() { - m_targets.clear (); + m_targets.clear(); } void - Targets::reserve (size_t size) + Targets::reserve(size_t size) { - m_targets.reserve (size); + m_targets.reserve(size); } } diff --git a/src/svncpp/url.cpp b/src/svncpp/url.cpp index 54385e81..d3bcf4cf 100644 --- a/src/svncpp/url.cpp +++ b/src/svncpp/url.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,9 +34,9 @@ namespace svn { - Url::Url () {} + Url::Url() {} - Url::~Url () {} + Url::~Url() {} /** * determines if a path is a url; escape unsupported characters @@ -45,11 +45,11 @@ namespace svn * @param urlToValidate url to be validated */ bool - Url::isValid (const char * urlToValidate) + Url::isValid(const char * urlToValidate) { - std::string escapedUrlToValidate = escape (urlToValidate); + std::string escapedUrlToValidate = escape(urlToValidate); - return svn_path_is_url (escapedUrlToValidate.c_str ()) != 0; + return svn_path_is_url(escapedUrlToValidate.c_str()) != 0; } /** @@ -60,11 +60,11 @@ namespace svn * @return string escaped url */ std::string - Url::escape (const char * url) + Url::escape(const char * url) { Pool pool; - return svn_path_uri_autoescape (url, pool); + return svn_path_uri_autoescape(url, pool); } /** @@ -76,11 +76,11 @@ namespace svn * @return string unescaped url */ std::string - Url::unescape (const char * url) + Url::unescape(const char * url) { Pool pool; - return svn_path_uri_decode (url, pool); + return svn_path_uri_decode(url, pool); } /** @@ -89,7 +89,7 @@ namespace svn * we are lacking a higher level of abstraction */ std::vector - Url::supportedSchemas () + Url::supportedSchemas() { std::vector schemas; diff --git a/src/svncpp/wc.cpp b/src/svncpp/wc.cpp index 4bd49fac..80296665 100644 --- a/src/svncpp/wc.cpp +++ b/src/svncpp/wc.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,21 +34,21 @@ namespace svn { - bool - Wc::checkWc (const char * dir) + bool + Wc::checkWc(const char * dir) { - Path path (dir); - return Wc::checkWc (path); + Path path(dir); + return Wc::checkWc(path); } bool - Wc::checkWc (const Path & dir) + Wc::checkWc(const Path & dir) { Pool pool; int wc; svn_error_t * error = - svn_wc_check_wc (dir.c_str (), &wc, pool); + svn_wc_check_wc(dir.c_str(), &wc, pool); if ((error != NULL) || (wc == 0)) { @@ -59,42 +59,42 @@ namespace svn } void - Wc::ensureAdm (const char * dir, const char *uuid, - const char * url, const Revision & revision) + Wc::ensureAdm(const char * dir, const char *uuid, + const char * url, const Revision & revision) { Pool pool; - Path dirPath (dir); - Path urlPath (url); + Path dirPath(dir); + Path urlPath(url); svn_error_t * error = - svn_wc_ensure_adm (dirPath.c_str (), // path - uuid, // UUID - urlPath.c_str (), // url - revision.revnum (), // revision - pool); - - if(error != NULL) - throw ClientException (error); + svn_wc_ensure_adm(dirPath.c_str(), // path + uuid, // UUID + urlPath.c_str(), // url + revision.revnum(), // revision + pool); + + if (error != NULL) + throw ClientException(error); } void - Wc::setAdmDir (const char * dir) + Wc::setAdmDir(const char * dir) { Pool pool; - svn_error_t * error = - svn_wc_set_adm_dir (dir, pool); + svn_error_t * error = + svn_wc_set_adm_dir(dir, pool); - if(error != NULL) - throw ClientException (error); + if (error != NULL) + throw ClientException(error); } bool - Wc::isAdmDir (const char * name) + Wc::isAdmDir(const char * name) { Pool pool; - return 0 != svn_wc_is_adm_dir (name, pool); + return 0 != svn_wc_is_adm_dir(name, pool); } } diff --git a/src/switch_action.cpp b/src/switch_action.cpp index 2dbcfd0e..3ddfff73 100644 --- a/src/switch_action.cpp +++ b/src/switch_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -46,73 +46,73 @@ struct SwitchAction::Data bool relocate; }; -SwitchAction::SwitchAction (wxWindow * parent) - : Action (parent, _("Switch URL")) +SwitchAction::SwitchAction(wxWindow * parent) + : Action(parent, _("Switch URL")) { - m = new Data (); + m = new Data(); } -SwitchAction::~SwitchAction () +SwitchAction::~SwitchAction() { delete m; } bool -SwitchAction::Prepare () +SwitchAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } // first try to get the URL for the target - svn::Path path = GetTarget (); - svn::Client client (GetContext ()); - svn::InfoVector infoVector (client.info (path)); - if (infoVector.size () != 1) + svn::Path path = GetTarget(); + svn::Client client(GetContext()); + svn::InfoVector infoVector(client.info(path)); + if (infoVector.size() != 1) return false; - m->old_url = Utf8ToLocal (svn::Url::unescape (infoVector[0].url ())); + m->old_url = Utf8ToLocal(svn::Url::unescape(infoVector[0].url())); - SwitchDlg dlg (GetParent (), m->old_url, true, false); + SwitchDlg dlg(GetParent(), m->old_url, true, false); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - m->new_url = dlg.GetUrl (); - m->revision = dlg.GetRevision (); - m->recursive = dlg.GetRecursive (); - m->relocate = dlg.GetRelocate (); + m->new_url = dlg.GetUrl(); + m->revision = dlg.GetRevision(); + m->recursive = dlg.GetRecursive(); + m->relocate = dlg.GetRelocate(); return true; } bool -SwitchAction::Perform () +SwitchAction::Perform() { - svn::Path path = GetTarget (); - svn::Client client (GetContext ()); + svn::Path path = GetTarget(); + svn::Client client(GetContext()); if (m->relocate) - client.relocate (path, - LocalToUtf8 (m->old_url).c_str (), - LocalToUtf8 (m->new_url).c_str (), - m->recursive); + client.relocate(path, + LocalToUtf8(m->old_url).c_str(), + LocalToUtf8(m->new_url).c_str(), + m->recursive); else - client.doSwitch (path, - LocalToUtf8 (m->new_url).c_str (), - m->revision, - m->recursive); - + client.doSwitch(path, + LocalToUtf8(m->new_url).c_str(), + m->revision, + m->recursive); + return true; } bool -SwitchAction::CheckStatusSel (const svn::StatusSel & statusSel) +SwitchAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/switch_action.hpp b/src/switch_action.hpp index aec5716c..3b81ab10 100644 --- a/src/switch_action.hpp +++ b/src/switch_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -48,18 +48,18 @@ class SwitchAction:public Action * * @param parent parent window */ - SwitchAction (wxWindow * parent); + SwitchAction(wxWindow * parent); - virtual ~SwitchAction (); + virtual ~SwitchAction(); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: struct Data; diff --git a/src/switch_dlg.cpp b/src/switch_dlg.cpp index 7aaf5663..dba907e8 100644 --- a/src/switch_dlg.cpp +++ b/src/switch_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -59,91 +59,91 @@ struct SwitchDlg::Data bool relocate; bool useLatest; - Data (wxWindow * window, const wxString & url_, - bool recursive_, bool relocate_) - : m_textRevision (0), m_checkUseLatest (0), m_comboUrl (0), - m_buttonOk (0), - url (url_), revision (wxT("")), - recursive (recursive_), relocate (relocate_), - useLatest (true) + Data(wxWindow * window, const wxString & url_, + bool recursive_, bool relocate_) + : m_textRevision(0), m_checkUseLatest(0), m_comboUrl(0), + m_buttonOk(0), + url(url_), revision(wxT("")), + recursive(recursive_), relocate(relocate_), + useLatest(true) { - wxBoxSizer *mainSizer = new wxBoxSizer (wxVERTICAL); - wxBoxSizer *middleSizer = new wxBoxSizer (wxVERTICAL); - wxBoxSizer *optionSizer = new wxBoxSizer (wxHORIZONTAL); - wxBoxSizer *buttonSizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); + wxBoxSizer *middleSizer = new wxBoxSizer(wxVERTICAL); + wxBoxSizer *optionSizer = new wxBoxSizer(wxHORIZONTAL); + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); // The URL fields: { - wxStaticBox * box = new wxStaticBox (window, -1, _("URL")); - wxStaticBoxSizer * sizer = new wxStaticBoxSizer (box, wxHORIZONTAL); + wxStaticBox * box = new wxStaticBox(window, -1, _("URL")); + wxStaticBoxSizer * sizer = new wxStaticBoxSizer(box, wxHORIZONTAL); - HistoryValidator val (HISTORY_REPOSITORY, &url); - m_comboUrl = new wxComboBox (window, ID_URL, wxEmptyString, - wxDefaultPosition, wxSize (235, -1), - 0, 0, wxCB_DROPDOWN, val); + HistoryValidator val(HISTORY_REPOSITORY, &url); + m_comboUrl = new wxComboBox(window, ID_URL, wxEmptyString, + wxDefaultPosition, wxSize(235, -1), + 0, 0, wxCB_DROPDOWN, val); - sizer->Add (m_comboUrl, 1, wxALL | wxEXPAND, 5); - middleSizer->Add (sizer, 1, wxALL | wxEXPAND, 5); + sizer->Add(m_comboUrl, 1, wxALL | wxEXPAND, 5); + middleSizer->Add(sizer, 1, wxALL | wxEXPAND, 5); } // The revision fields: { - wxStaticBox * box = new wxStaticBox (window, -1, _("Revision")); - wxStaticBoxSizer *revSizer = new wxStaticBoxSizer (box, wxHORIZONTAL); + wxStaticBox * box = new wxStaticBox(window, -1, _("Revision")); + wxStaticBoxSizer *revSizer = new wxStaticBoxSizer(box, wxHORIZONTAL); + + wxTextValidator val(wxFILTER_NUMERIC, &revision); + m_textRevision = new wxTextCtrl(window, ID_REVISION, wxEmptyString, + wxDefaultPosition, + wxDefaultSize, 0, val); + revSizer->Add(m_textRevision, 1, + wxALL | wxALIGN_CENTER_VERTICAL | wxEXPAND, 5); + + wxGenericValidator valUseLatest(&useLatest); + m_checkUseLatest = new wxCheckBox(window, ID_USELATEST, + _("Use latest"), + wxDefaultPosition, + wxDefaultSize, 0, valUseLatest); + revSizer->Add(m_checkUseLatest, 0, + wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); - wxTextValidator val (wxFILTER_NUMERIC, &revision); - m_textRevision = new wxTextCtrl (window, ID_REVISION, wxEmptyString, - wxDefaultPosition, - wxDefaultSize, 0, val); - revSizer->Add (m_textRevision, 1, - wxALL | wxALIGN_CENTER_VERTICAL | wxEXPAND, 5); - - wxGenericValidator valUseLatest (&useLatest); - m_checkUseLatest = new wxCheckBox (window, ID_USELATEST, - _("Use latest"), - wxDefaultPosition, - wxDefaultSize, 0, valUseLatest); - revSizer->Add (m_checkUseLatest, 0, - wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); - - middleSizer->Add (revSizer, 1, wxALL | wxEXPAND, 5); + middleSizer->Add(revSizer, 1, wxALL | wxEXPAND, 5); } // The recursive checkbox - + { - wxGenericValidator val (&recursive); + wxGenericValidator val(&recursive); wxCheckBox * checkRecursive = - new wxCheckBox (window, -1, _("Recursive"), - wxDefaultPosition, wxDefaultSize, 0, val); - optionSizer->Add (checkRecursive, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL , 5); + new wxCheckBox(window, -1, _("Recursive"), + wxDefaultPosition, wxDefaultSize, 0, val); + optionSizer->Add(checkRecursive, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL , 5); } // The "relocate" checkbox { - wxGenericValidator val (&relocate); - m_checkRelocate = new wxCheckBox (window, ID_RELOCATE, - _("Relocate"), - wxDefaultPosition, - wxDefaultSize, 0, - val); - optionSizer->Add (m_checkRelocate, 0, - wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); + wxGenericValidator val(&relocate); + m_checkRelocate = new wxCheckBox(window, ID_RELOCATE, + _("Relocate"), + wxDefaultPosition, + wxDefaultSize, 0, + val); + optionSizer->Add(m_checkRelocate, 0, + wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); } // The buttons: - m_buttonOk = new wxButton (window, wxID_OK, _("OK" )); - buttonSizer->Add (m_buttonOk, 0, wxALL, 10); - wxButton * button = new wxButton (window, wxID_CANCEL, _("Cancel")); - buttonSizer->Add (button, 0, wxALL, 10); + m_buttonOk = new wxButton(window, wxID_OK, _("OK")); + buttonSizer->Add(m_buttonOk, 0, wxALL, 10); + wxButton * button = new wxButton(window, wxID_CANCEL, _("Cancel")); + buttonSizer->Add(button, 0, wxALL, 10); // Add all the sizers to the main sizer - mainSizer->Add (middleSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (optionSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (5, 5, 1, wxEXPAND); - mainSizer->Add (buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); + mainSizer->Add(middleSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(optionSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(5, 5, 1, wxEXPAND); + mainSizer->Add(buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); window->SetAutoLayout(true); window->SetSizer(mainSizer); @@ -151,7 +151,7 @@ struct SwitchDlg::Data mainSizer->SetSizeHints(window); mainSizer->Fit(window); - m_buttonOk->SetDefault (); + m_buttonOk->SetDefault(); } void @@ -161,48 +161,48 @@ struct SwitchDlg::Data } void - CheckButtons () + CheckButtons() { bool ok = true; - if (!m_checkUseLatest->IsChecked ()) + if (!m_checkUseLatest->IsChecked()) { - ok = CheckRevision (m_textRevision->GetValue ()); + ok = CheckRevision(m_textRevision->GetValue()); } if (ok) { - svn::Path UrlUtf8 (PathUtf8 (m_comboUrl->GetValue ())); - ok = UrlUtf8.isUrl (); + svn::Path UrlUtf8(PathUtf8(m_comboUrl->GetValue())); + ok = UrlUtf8.isUrl(); } - m_buttonOk->Enable (ok); + m_buttonOk->Enable(ok); } }; -BEGIN_EVENT_TABLE (SwitchDlg, wxDialog) - EVT_CHECKBOX (ID_USELATEST, SwitchDlg::OnUseLatest) - EVT_TEXT (ID_URL, SwitchDlg::OnText) - EVT_TEXT (ID_REVISION, SwitchDlg::OnText) -END_EVENT_TABLE () - -SwitchDlg::SwitchDlg (wxWindow* parent, const wxString & url, - bool recursive, bool relocate) - : wxDialog(parent, -1, _("Switch URL"), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +BEGIN_EVENT_TABLE(SwitchDlg, wxDialog) + EVT_CHECKBOX(ID_USELATEST, SwitchDlg::OnUseLatest) + EVT_TEXT(ID_URL, SwitchDlg::OnText) + EVT_TEXT(ID_REVISION, SwitchDlg::OnText) +END_EVENT_TABLE() + +SwitchDlg::SwitchDlg(wxWindow* parent, const wxString & url, + bool recursive, bool relocate) + : wxDialog(parent, -1, _("Switch URL"), + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - m = new Data (this, url, recursive, relocate); + m = new Data(this, url, recursive, relocate); CentreOnParent(); wxDialog::InitDialog(); m->EnableControls(); - m->CheckButtons (); + m->CheckButtons(); } -SwitchDlg::~SwitchDlg () +SwitchDlg::~SwitchDlg() { delete m; } @@ -211,17 +211,17 @@ void SwitchDlg::OnUseLatest(wxCommandEvent &) { m->EnableControls(); - m->CheckButtons (); + m->CheckButtons(); } void -SwitchDlg::OnText (wxCommandEvent &) +SwitchDlg::OnText(wxCommandEvent &) { - m->CheckButtons (); + m->CheckButtons(); } svn::Revision -SwitchDlg::GetRevision () const +SwitchDlg::GetRevision() const { if (m->useLatest) return svn::Revision::HEAD; @@ -229,30 +229,30 @@ SwitchDlg::GetRevision () const { svn_revnum_t revnum; - TrimString (m->revision); - m->revision.ToLong (&revnum); + TrimString(m->revision); + m->revision.ToLong(&revnum); return revnum; } } -const wxString & -SwitchDlg::GetUrl () const +const wxString & +SwitchDlg::GetUrl() const { return m->url; } -bool -SwitchDlg::GetRelocate () const +bool +SwitchDlg::GetRelocate() const { return m->relocate; } -bool -SwitchDlg::GetRecursive () const +bool +SwitchDlg::GetRecursive() const { return m->recursive; } diff --git a/src/switch_dlg.hpp b/src/switch_dlg.hpp index 5f1d93cd..0d9038b5 100644 --- a/src/switch_dlg.hpp +++ b/src/switch_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -44,25 +44,25 @@ class SwitchDlg:public wxDialog * @param flags flags for the window (@a WITH_URL) * @param recursive default flag for the "recursive" check */ - SwitchDlg (wxWindow* parent, const wxString & url, - bool recursive, bool relocate); + SwitchDlg(wxWindow* parent, const wxString & url, + bool recursive, bool relocate); /** * destructor */ - virtual ~SwitchDlg (); + virtual ~SwitchDlg(); - const wxString & - GetUrl () const; + const wxString & + GetUrl() const; svn::Revision - GetRevision () const; - - bool - GetRecursive () const; + GetRevision() const; - bool - GetRelocate () const; + bool + GetRecursive() const; + + bool + GetRelocate() const; private: struct Data; @@ -72,7 +72,7 @@ class SwitchDlg:public wxDialog OnUseLatest(wxCommandEvent &event); void - OnText (wxCommandEvent & event); + OnText(wxCommandEvent & event); DECLARE_EVENT_TABLE() }; diff --git a/src/tests/svncpp/main.cpp b/src/tests/svncpp/main.cpp index d9c4575e..6c28b0c7 100644 --- a/src/tests/svncpp/main.cpp +++ b/src/tests/svncpp/main.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -26,13 +26,13 @@ #include "cppunit/extensions/HelperMacros.h" int -main (int argc, char **argv) +main(int argc, char **argv) { CppUnit::TextUi::TestRunner runner; - CppUnit::TestFactoryRegistry ®istry = - CppUnit::TestFactoryRegistry::getRegistry (); - runner.addTest (registry.makeTest()); - bool wasSucessful = runner.run ("", false); + CppUnit::TestFactoryRegistry ®istry = + CppUnit::TestFactoryRegistry::getRegistry(); + runner.addTest(registry.makeTest()); + bool wasSucessful = runner.run("", false); return wasSucessful; } diff --git a/src/tests/svncpp/svncpp.cpp b/src/tests/svncpp/svncpp.cpp index 2706dd0d..fd80b349 100644 --- a/src/tests/svncpp/svncpp.cpp +++ b/src/tests/svncpp/svncpp.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -25,37 +25,37 @@ #include "svncpp.hpp" #include -CPPUNIT_TEST_SUITE_REGISTRATION( SvnCppTestCase ); +CPPUNIT_TEST_SUITE_REGISTRATION(SvnCppTestCase); void -SvnCppTestCase::setUp () +SvnCppTestCase::setUp() { } void -SvnCppTestCase::testStatus () +SvnCppTestCase::testStatus() { svn::Client client; - svn::Status * status = client.singleStatus ("my_repos/README.txt"); + svn::Status * status = client.singleStatus("my_repos/README.txt"); - CPPUNIT_ASSERT (status->isVersioned ()); - CPPUNIT_ASSERT (strcmp(status->textDescription (), "normal") == 0); - CPPUNIT_ASSERT_EQUAL (svn_wc_status_normal, status->textType ()); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)3, status->revision ()); - CPPUNIT_ASSERT (status->isLocked () == false); - CPPUNIT_ASSERT (status->isCopied () == false); + CPPUNIT_ASSERT(status->isVersioned()); + CPPUNIT_ASSERT(strcmp(status->textDescription(), "normal") == 0); + CPPUNIT_ASSERT_EQUAL(svn_wc_status_normal, status->textType()); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)3, status->revision()); + CPPUNIT_ASSERT(status->isLocked() == false); + CPPUNIT_ASSERT(status->isCopied() == false); - svn::Status * status2 = client.singleStatus ("my_repos/main.cpp"); - CPPUNIT_ASSERT (strcmp(status2->textDescription (), "modified") == 0); - CPPUNIT_ASSERT_EQUAL (svn_wc_status_modified, status2->textType ()); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)1, status2->revision ()); + svn::Status * status2 = client.singleStatus("my_repos/main.cpp"); + CPPUNIT_ASSERT(strcmp(status2->textDescription(), "modified") == 0); + CPPUNIT_ASSERT_EQUAL(svn_wc_status_modified, status2->textType()); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)1, status2->revision()); try { - svn::Status * status3 = client.singleStatus ("my_repos/status.cpp"); - status3->textDescription (); - status3->revision (); - CPPUNIT_ASSERT_MESSAGE ("No exception!", false); + svn::Status * status3 = client.singleStatus("my_repos/status.cpp"); + status3->textDescription(); + status3->revision(); + CPPUNIT_ASSERT_MESSAGE("No exception!", false); } catch (...) { @@ -63,73 +63,73 @@ SvnCppTestCase::testStatus () } void -SvnCppTestCase::testCheckout () +SvnCppTestCase::testCheckout() { svn::Modify modify; std::string sPath = CHECKOUT_PATH; sPath += "/README.txt"; - modify.notification (¬ify); + modify.notification(¬ify); try { - modify.checkout ("fake_path", CHECKOUT_PATH, -1, 1); - CPPUNIT_ASSERT (false); // it should not get here + modify.checkout("fake_path", CHECKOUT_PATH, -1, 1); + CPPUNIT_ASSERT(false); // it should not get here } catch (svn::ClientException &e) { - CPPUNIT_ASSERT (strlen(e.description ()) > 0); - CPPUNIT_ASSERT (strlen(e.source ()) > 0); + CPPUNIT_ASSERT(strlen(e.description()) > 0); + CPPUNIT_ASSERT(strlen(e.source()) > 0); } try { - modify.checkout (REPOS_PATH, CHECKOUT_PATH, -1, 1); + modify.checkout(REPOS_PATH, CHECKOUT_PATH, -1, 1); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), - strlen(e.description ()) < 1); + CPPUNIT_ASSERT_MESSAGE(e.description(), + strlen(e.description()) < 1); } svn::Client client; - svn::Status * status = client.singleStatus (sPath.c_str ()); + svn::Status * status = client.singleStatus(sPath.c_str()); - CPPUNIT_ASSERT (status->isVersioned ()); - CPPUNIT_ASSERT (strcmp(status->textDescription (), "normal") == 0); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)3, status->revision ()); + CPPUNIT_ASSERT(status->isVersioned()); + CPPUNIT_ASSERT(strcmp(status->textDescription(), "normal") == 0); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)3, status->revision()); } void -SvnCppTestCase::testDeleteRevert () +SvnCppTestCase::testDeleteRevert() { svn::Modify modify; svn::Client client; - modify.notification (¬ify); + modify.notification(¬ify); try { - modify.remove ("my_repos/README.txt", false); + modify.remove("my_repos/README.txt", false); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } - svn::Status * status = client.singleStatus ("my_repos/README.txt"); - CPPUNIT_ASSERT (status->isVersioned ()); - CPPUNIT_ASSERT (strcmp(status->textDescription (), "deleted") == 0); + svn::Status * status = client.singleStatus("my_repos/README.txt"); + CPPUNIT_ASSERT(status->isVersioned()); + CPPUNIT_ASSERT(strcmp(status->textDescription(), "deleted") == 0); try { - modify.remove ("my_repos/main.cpp", true); // with forcing - modify.revert ("my_repos/README.txt", false); - modify.revert ("my_repos/main.cpp", false); + modify.remove("my_repos/main.cpp", true); // with forcing + modify.revert("my_repos/README.txt", false); + modify.revert("my_repos/main.cpp", false); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } /* @@ -141,242 +141,242 @@ SvnCppTestCase::testDeleteRevert () } void -SvnCppTestCase::testAdd () +SvnCppTestCase::testAdd() { svn::Modify modify; svn::Client client; - modify.notification (¬ify); + modify.notification(¬ify); try { - modify.add ("my_repos/svncpp.h", true); - svn::Status * status = client.singleStatus ("my_repos/svncpp.h"); - CPPUNIT_ASSERT (strcmp(status->textDescription (), "added") == 0); + modify.add("my_repos/svncpp.h", true); + svn::Status * status = client.singleStatus("my_repos/svncpp.h"); + CPPUNIT_ASSERT(strcmp(status->textDescription(), "added") == 0); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } } void -SvnCppTestCase::testUpdate () +SvnCppTestCase::testUpdate() { svn::Modify modify; - modify.notification (¬ify); + modify.notification(¬ify); try { - modify.update ("my_repos", -1, true); + modify.update("my_repos", -1, true); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } } void -SvnCppTestCase::testCommit () +SvnCppTestCase::testCommit() { svn::Modify modify; svn::Client client; - modify.notification (¬ify); + modify.notification(¬ify); - modify.username (""); - modify.password (""); + modify.username(""); + modify.password(""); try { - modify.commit ("my_repos", "Message logged by SvnCpp!", true); - svn::Status * status = client.singleStatus ("my_repos/svncpp.h"); - CPPUNIT_ASSERT (status->isVersioned ()); - CPPUNIT_ASSERT (strcmp(status->textDescription (), "normal") == 0); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)4, status->revision ()); - - svn::Status * status2 = client.singleStatus ("my_repos/main.cpp"); - CPPUNIT_ASSERT (strcmp(status2->textDescription (), "normal") == 0); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)3, status2->revision ()); + modify.commit("my_repos", "Message logged by SvnCpp!", true); + svn::Status * status = client.singleStatus("my_repos/svncpp.h"); + CPPUNIT_ASSERT(status->isVersioned()); + CPPUNIT_ASSERT(strcmp(status->textDescription(), "normal") == 0); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)4, status->revision()); + + svn::Status * status2 = client.singleStatus("my_repos/main.cpp"); + CPPUNIT_ASSERT(strcmp(status2->textDescription(), "normal") == 0); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)3, status2->revision()); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } } void -SvnCppTestCase::testCopy () +SvnCppTestCase::testCopy() { svn::Modify modify; svn::Client client; - modify.notification (¬ify); + modify.notification(¬ify); try { - modify.copy ("my_repos/main.cpp", "my_repos/my_dir/main2.cpp"); - svn::Status * status = client.singleStatus ("my_repos/my_dir/main2.cpp"); - CPPUNIT_ASSERT (status->isVersioned ()); - CPPUNIT_ASSERT (strcmp(status->textDescription (), "added") == 0); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)3, status->revision ()); + modify.copy("my_repos/main.cpp", "my_repos/my_dir/main2.cpp"); + svn::Status * status = client.singleStatus("my_repos/my_dir/main2.cpp"); + CPPUNIT_ASSERT(status->isVersioned()); + CPPUNIT_ASSERT(strcmp(status->textDescription(), "added") == 0); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)3, status->revision()); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } } void -SvnCppTestCase::testMove () +SvnCppTestCase::testMove() { svn::Modify modify; svn::Client client; - modify.notification (¬ify); + modify.notification(¬ify); try { - modify.move ("my_repos/svncpp.h", "my_repos/my_dir/svncpp.h", -1, true); - svn::Status * status = client.singleStatus ("my_repos/svncpp.h"); - CPPUNIT_ASSERT (status->isVersioned ()); - CPPUNIT_ASSERT (strcmp(status->textDescription (), "deleted") == 0); + modify.move("my_repos/svncpp.h", "my_repos/my_dir/svncpp.h", -1, true); + svn::Status * status = client.singleStatus("my_repos/svncpp.h"); + CPPUNIT_ASSERT(status->isVersioned()); + CPPUNIT_ASSERT(strcmp(status->textDescription(), "deleted") == 0); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } // Check if added try { - svn::Status * status2 = client.singleStatus ("my_repos/my_dir/svncpp.h"); - CPPUNIT_ASSERT (status2->isVersioned ()); - CPPUNIT_ASSERT (strcmp(status2->textDescription (), "added") == 0); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)3, status2->revision ()); + svn::Status * status2 = client.singleStatus("my_repos/my_dir/svncpp.h"); + CPPUNIT_ASSERT(status2->isVersioned()); + CPPUNIT_ASSERT(strcmp(status2->textDescription(), "added") == 0); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)3, status2->revision()); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } } void -SvnCppTestCase::testProperty () +SvnCppTestCase::testProperty() { svn::Property property; - property.loadPath ("my_repos/main.cpp"); - CPPUNIT_ASSERT (property.isVersioned ()); - CPPUNIT_ASSERT_EQUAL (2, property.count ()); + property.loadPath("my_repos/main.cpp"); + CPPUNIT_ASSERT(property.isVersioned()); + CPPUNIT_ASSERT_EQUAL(2, property.count()); // Iteration tests - CPPUNIT_ASSERT (property.next ()); - CPPUNIT_ASSERT (strcmp (property.name (), "test") == 0); - CPPUNIT_ASSERT (strcmp (property.value (), "test_value") == 0); + CPPUNIT_ASSERT(property.next()); + CPPUNIT_ASSERT(strcmp(property.name(), "test") == 0); + CPPUNIT_ASSERT(strcmp(property.value(), "test_value") == 0); - CPPUNIT_ASSERT (property.next ()); - CPPUNIT_ASSERT (strcmp (property.name (), "test2") == 0); - CPPUNIT_ASSERT (strcmp (property.value (), "test_value2") == 0); + CPPUNIT_ASSERT(property.next()); + CPPUNIT_ASSERT(strcmp(property.name(), "test2") == 0); + CPPUNIT_ASSERT(strcmp(property.value(), "test_value2") == 0); - CPPUNIT_ASSERT (property.first ()); - CPPUNIT_ASSERT (strcmp (property.name (), "test") == 0); - CPPUNIT_ASSERT (strcmp (property.value (), "test_value") == 0); + CPPUNIT_ASSERT(property.first()); + CPPUNIT_ASSERT(strcmp(property.name(), "test") == 0); + CPPUNIT_ASSERT(strcmp(property.value(), "test_value") == 0); try { - property.set ("new_test", "something", false); + property.set("new_test", "something", false); } catch (...) { - CPPUNIT_ASSERT (false); + CPPUNIT_ASSERT(false); } - property.loadPath ("my_repos/main.cpp"); - CPPUNIT_ASSERT_EQUAL (3, property.count ()); + property.loadPath("my_repos/main.cpp"); + CPPUNIT_ASSERT_EQUAL(3, property.count()); try { - property.remove ("new_test", false); + property.remove("new_test", false); } catch (...) { - CPPUNIT_ASSERT (false); + CPPUNIT_ASSERT(false); } - property.loadPath ("my_repos/main.cpp"); - CPPUNIT_ASSERT_EQUAL (2, property.count ()); + property.loadPath("my_repos/main.cpp"); + CPPUNIT_ASSERT_EQUAL(2, property.count()); } void -SvnCppTestCase::testMkdir () +SvnCppTestCase::testMkdir() { svn::Modify modify; svn::Client client; - modify.notification (¬ify); + modify.notification(¬ify); try { - modify.mkdir ("my_repos/new_dir", "Created a new directory"); - svn::Status * status = client.singleStatus ("my_repos/new_dir"); - CPPUNIT_ASSERT (status->isVersioned ()); - CPPUNIT_ASSERT (strcmp(status->textDescription (), "added") == 0); + modify.mkdir("my_repos/new_dir", "Created a new directory"); + svn::Status * status = client.singleStatus("my_repos/new_dir"); + CPPUNIT_ASSERT(status->isVersioned()); + CPPUNIT_ASSERT(strcmp(status->textDescription(), "added") == 0); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } } void -SvnCppTestCase::testExport () +SvnCppTestCase::testExport() { svn::Modify modify; svn::Client client; - modify.notification (¬ify); + modify.notification(¬ify); try { - modify.doExport ("my_repos", "my_repos/export_dir", 2); - svn::Status * status = client.singleStatus ("my_repos/export_dir"); - CPPUNIT_ASSERT (status == NULL); + modify.doExport("my_repos", "my_repos/export_dir", 2); + svn::Status * status = client.singleStatus("my_repos/export_dir"); + CPPUNIT_ASSERT(status == NULL); } catch (svn::ClientException &e) { - CPPUNIT_ASSERT_MESSAGE (e.description (), false); + CPPUNIT_ASSERT_MESSAGE(e.description(), false); } } void -SvnCppTestCase::testLog () +SvnCppTestCase::testLog() { svn::Log log; - log.loadPath ("my_repos/README.txt", 1, 3); - CPPUNIT_ASSERT (log.isVersioned ()); + log.loadPath("my_repos/README.txt", 1, 3); + CPPUNIT_ASSERT(log.isVersioned()); - CPPUNIT_ASSERT_EQUAL (3, log.count ()); - CPPUNIT_ASSERT (log.next ()); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)1, log.revision ()); + CPPUNIT_ASSERT_EQUAL(3, log.count()); + CPPUNIT_ASSERT(log.next()); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)1, log.revision()); // Test next more than one time. - CPPUNIT_ASSERT (log.next ()); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)2, log.revision ()); - CPPUNIT_ASSERT (log.previous ()); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)1, log.revision ()); - CPPUNIT_ASSERT (log.last ()); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)3, log.revision ()); - CPPUNIT_ASSERT (log.next () == false); + CPPUNIT_ASSERT(log.next()); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)2, log.revision()); + CPPUNIT_ASSERT(log.previous()); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)1, log.revision()); + CPPUNIT_ASSERT(log.last()); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)3, log.revision()); + CPPUNIT_ASSERT(log.next() == false); // Test message and date - CPPUNIT_ASSERT (strcmp ("more changes", log.message ()) == 0); - CPPUNIT_ASSERT (strlen (log.date ()) > 0); + CPPUNIT_ASSERT(strcmp("more changes", log.message()) == 0); + CPPUNIT_ASSERT(strlen(log.date()) > 0); // Test first - CPPUNIT_ASSERT (log.first ()); - CPPUNIT_ASSERT_EQUAL ((svn_revnum_t)1, log.revision ()); + CPPUNIT_ASSERT(log.first()); + CPPUNIT_ASSERT_EQUAL((svn_revnum_t)1, log.revision()); } /* ----------------------------------------------------------------- diff --git a/src/tests/svncpp/svncpp.hpp b/src/tests/svncpp/svncpp.hpp index c5e25122..2374535f 100644 --- a/src/tests/svncpp/svncpp.hpp +++ b/src/tests/svncpp/svncpp.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,54 +34,54 @@ */ class SvnCppTestCase : public CppUnit::TestCase { - CPPUNIT_TEST_SUITE( SvnCppTestCase ); - CPPUNIT_TEST( testStatus ); - CPPUNIT_TEST( testCheckout ); - CPPUNIT_TEST( testDeleteRevert ); - CPPUNIT_TEST( testAdd ); - CPPUNIT_TEST( testUpdate ); - CPPUNIT_TEST( testCommit ); - CPPUNIT_TEST( testCopy ); - CPPUNIT_TEST( testMove ); - CPPUNIT_TEST( testMkdir ); - CPPUNIT_TEST( testExport ); - CPPUNIT_TEST( testProperty ); - CPPUNIT_TEST( testLog ); + CPPUNIT_TEST_SUITE(SvnCppTestCase); + CPPUNIT_TEST(testStatus); + CPPUNIT_TEST(testCheckout); + CPPUNIT_TEST(testDeleteRevert); + CPPUNIT_TEST(testAdd); + CPPUNIT_TEST(testUpdate); + CPPUNIT_TEST(testCommit); + CPPUNIT_TEST(testCopy); + CPPUNIT_TEST(testMove); + CPPUNIT_TEST(testMkdir); + CPPUNIT_TEST(testExport); + CPPUNIT_TEST(testProperty); + CPPUNIT_TEST(testLog); CPPUNIT_TEST_SUITE_END(); private: svn::Notify notify; public: - void setUp (); + void setUp(); protected: /** * Tests all of the status methods. */ - void testStatus (); + void testStatus(); - void testCheckout (); + void testCheckout(); - void testDeleteRevert (); + void testDeleteRevert(); - void testAdd (); + void testAdd(); - void testUpdate (); + void testUpdate(); - void testCommit (); + void testCommit(); - void testCopy (); + void testCopy(); - void testMove (); + void testMove(); - void testProperty (); + void testProperty(); - void testMkdir (); + void testMkdir(); - void testExport (); + void testExport(); - void testLog (); + void testLog(); }; /** diff --git a/src/tests/svncpp/test_path.cpp b/src/tests/svncpp/test_path.cpp index fbc347b7..774f5ce5 100644 --- a/src/tests/svncpp/test_path.cpp +++ b/src/tests/svncpp/test_path.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -33,69 +33,69 @@ //svncpp #include "svncpp/path.hpp" -CPPUNIT_TEST_SUITE_REGISTRATION (PathTestCase); +CPPUNIT_TEST_SUITE_REGISTRATION(PathTestCase); void -PathTestCase::setUp () +PathTestCase::setUp() { } void -PathTestCase::testInit () +PathTestCase::testInit() { svn::Path pathEmpty; - CPPUNIT_ASSERT (strcmp ("", pathEmpty.c_str ()) == 0); - CPPUNIT_ASSERT (pathEmpty.isset () == false); + CPPUNIT_ASSERT(strcmp("", pathEmpty.c_str()) == 0); + CPPUNIT_ASSERT(pathEmpty.isset() == false); svn::Path pathOne = "/some/path/to/repository"; - CPPUNIT_ASSERT (strcmp ("/some/path/to/repository", pathOne.c_str ()) == 0); - CPPUNIT_ASSERT (pathOne.isset ()); + CPPUNIT_ASSERT(strcmp("/some/path/to/repository", pathOne.c_str()) == 0); + CPPUNIT_ASSERT(pathOne.isset()); svn::Path pathTwo = "http://this.is/a/url"; - CPPUNIT_ASSERT (strcmp ("http://this.is/a/url", pathTwo.c_str ()) == 0); - CPPUNIT_ASSERT (pathTwo.isset ()); + CPPUNIT_ASSERT(strcmp("http://this.is/a/url", pathTwo.c_str()) == 0); + CPPUNIT_ASSERT(pathTwo.isset()); svn::Path pathThree = "file:///this.is/a/url"; - CPPUNIT_ASSERT (strcmp ("file:///this.is/a/url", pathThree.c_str ()) == 0); - CPPUNIT_ASSERT (pathThree.isset ()); + CPPUNIT_ASSERT(strcmp("file:///this.is/a/url", pathThree.c_str()) == 0); + CPPUNIT_ASSERT(pathThree.isset()); } void -PathTestCase::testSplit () +PathTestCase::testSplit() { svn::Path pathTest = "/some/path/to/repository"; std::string dirpath = ""; std::string basename = ""; - pathTest.split (dirpath, basename); - CPPUNIT_ASSERT (dirpath == "/some/path/to"); - CPPUNIT_ASSERT (basename == "repository"); + pathTest.split(dirpath, basename); + CPPUNIT_ASSERT(dirpath == "/some/path/to"); + CPPUNIT_ASSERT(basename == "repository"); svn::Path test1 = "file.txt"; std::string dir, file, ext; - test1.split (dir, file, ext); - CPPUNIT_ASSERT (strcmp (file.c_str (), "file") == 0); - CPPUNIT_ASSERT (strcmp (dir.c_str (), "") == 0); - CPPUNIT_ASSERT (strcmp (ext.c_str (), ".txt") == 0); + test1.split(dir, file, ext); + CPPUNIT_ASSERT(strcmp(file.c_str(), "file") == 0); + CPPUNIT_ASSERT(strcmp(dir.c_str(), "") == 0); + CPPUNIT_ASSERT(strcmp(ext.c_str(), ".txt") == 0); } void -PathTestCase::testAddComponent () +PathTestCase::testAddComponent() { svn::Path pathTest = "/some/path/to/foo"; std::string newBasename = "newname"; - pathTest.addComponent (newBasename); - CPPUNIT_ASSERT (0 == strcmp (pathTest.c_str(), - "/some/path/to/foo/newname")); + pathTest.addComponent(newBasename); + CPPUNIT_ASSERT(0 == strcmp(pathTest.c_str(), + "/some/path/to/foo/newname")); svn::Path urlTest = "http://some/url/to/repository"; std::string newFile = "newname"; - urlTest.addComponent (newFile); - CPPUNIT_ASSERT (0 == strcmp (urlTest.c_str(), - "http://some/url/to/repository/newname")); + urlTest.addComponent(newFile); + CPPUNIT_ASSERT(0 == strcmp(urlTest.c_str(), + "http://some/url/to/repository/newname")); // Now test every possible combination: // * add another absolute UNIX path to a UNIX path @@ -112,118 +112,118 @@ PathTestCase::testAddComponent () static const char * win2 = "c:/some/path/to/foo"; // URL1+URL2=URL2 - svn::Path path (url1); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), url1)); - path.addComponent (url2); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), url2)); + svn::Path path(url1); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), url1)); + path.addComponent(url2); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), url2)); // URL1+WIN2=WIN2 path = url1; - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), url1)); - path.addComponent (win2); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), win2)); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), url1)); + path.addComponent(win2); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), win2)); // URL1+UNIX2=UNIX2 path = url1; - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), url1)); - path.addComponent (unix2); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), unix2)); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), url1)); + path.addComponent(unix2); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), unix2)); // WIN1+URL2=URL2 path = win1; - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), win1)); - path.addComponent (url2); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), url2)); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), win1)); + path.addComponent(url2); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), url2)); // WIN1+WIN2=WIN2 path = win1; - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), win1)); - path.addComponent (win2); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), win2)); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), win1)); + path.addComponent(win2); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), win2)); // WIN1+UNIX2=UNIX2 path = win1; - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), win1)); - path.addComponent (unix2); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), unix2)); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), win1)); + path.addComponent(unix2); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), unix2)); // UNIX1+URL2=URL2 path = unix1; - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), unix1)); - path.addComponent (url2); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), url2)); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), unix1)); + path.addComponent(url2); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), url2)); // UNIX1+WIN2=WIN2 path = unix1; - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), unix1)); - path.addComponent (win2); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), win2)); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), unix1)); + path.addComponent(win2); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), win2)); // UNIX1+UNIX2=UNIX2 path = unix1; - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), unix1)); - path.addComponent (unix2); - CPPUNIT_ASSERT (0 == strcmp (path.c_str (), unix2)); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), unix1)); + path.addComponent(unix2); + CPPUNIT_ASSERT(0 == strcmp(path.c_str(), unix2)); } void -PathTestCase::testCopy () +PathTestCase::testCopy() { svn::Path pathOne = "/some/path"; svn::Path pathTwo = pathOne; - CPPUNIT_ASSERT (strcmp (pathOne.c_str (), pathTwo.c_str ()) == 0); + CPPUNIT_ASSERT(strcmp(pathOne.c_str(), pathTwo.c_str()) == 0); } void -PathTestCase::testIsUrl () +PathTestCase::testIsUrl() { svn::Path pathOne = "file:///this.is/a/url"; - CPPUNIT_ASSERT (pathOne.isUrl ()); - CPPUNIT_ASSERT (strcmp (pathOne.c_str (), "file:///this.is/a/url") == 0); + CPPUNIT_ASSERT(pathOne.isUrl()); + CPPUNIT_ASSERT(strcmp(pathOne.c_str(), "file:///this.is/a/url") == 0); } void -PathTestCase::testSubstr () +PathTestCase::testSubstr() { - svn::Path test ("/home/sleepy/tmp/sf âê/Bla Bla Blubb"); + svn::Path test("/home/sleepy/tmp/sf âê/Bla Bla Blubb"); int length = 25; std::string result = ""; - result = test.substr (length); - CPPUNIT_ASSERT (result == "Bla Bla Blubb"); + result = test.substr(length); + CPPUNIT_ASSERT(result == "Bla Bla Blubb"); } void -PathTestCase::testUnescape () +PathTestCase::testUnescape() { - svn::Path test ("/home/sleepy/tmp/sf%20x%20y"); - CPPUNIT_ASSERT (test.unescape () == "/home/sleepy/tmp/sf x y"); + svn::Path test("/home/sleepy/tmp/sf%20x%20y"); + CPPUNIT_ASSERT(test.unescape() == "/home/sleepy/tmp/sf x y"); } void -PathTestCase::testLength () +PathTestCase::testLength() { - svn::Path test ("/tmp/sf%20x%20y"); - CPPUNIT_ASSERT (test.length () == 15); + svn::Path test("/tmp/sf%20x%20y"); + CPPUNIT_ASSERT(test.length() == 15); } void -PathTestCase::testGetTempDir () +PathTestCase::testGetTempDir() { - svn::Path path (svn::Path::getTempDir ()); + svn::Path path(svn::Path::getTempDir()); // did we receive a path? - CPPUNIT_ASSERT (path.length () > 0); + CPPUNIT_ASSERT(path.length() > 0); // now, can we create a file in there? - path.addComponent ("foo.txt"); + path.addComponent("foo.txt"); - FILE * f = fopen (path.native ().c_str (), "w"); - CPPUNIT_ASSERT (f != NULL); + FILE * f = fopen(path.native().c_str(), "w"); + CPPUNIT_ASSERT(f != NULL); - fputs ("This is a teststring\n", f); - fclose (f); + fputs("This is a teststring\n", f); + fclose(f); } diff --git a/src/tests/svncpp/test_path.hpp b/src/tests/svncpp/test_path.hpp index ecc5c2a8..1c038032 100644 --- a/src/tests/svncpp/test_path.hpp +++ b/src/tests/svncpp/test_path.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -29,31 +29,31 @@ */ class PathTestCase : public CppUnit::TestCase { - CPPUNIT_TEST_SUITE (PathTestCase); - CPPUNIT_TEST (testInit); - CPPUNIT_TEST (testSplit); - CPPUNIT_TEST (testAddComponent); - CPPUNIT_TEST (testCopy); - CPPUNIT_TEST (testIsUrl); - CPPUNIT_TEST (testSubstr); - CPPUNIT_TEST (testUnescape); - CPPUNIT_TEST (testLength); - CPPUNIT_TEST (testGetTempDir); - CPPUNIT_TEST_SUITE_END (); + CPPUNIT_TEST_SUITE(PathTestCase); + CPPUNIT_TEST(testInit); + CPPUNIT_TEST(testSplit); + CPPUNIT_TEST(testAddComponent); + CPPUNIT_TEST(testCopy); + CPPUNIT_TEST(testIsUrl); + CPPUNIT_TEST(testSubstr); + CPPUNIT_TEST(testUnescape); + CPPUNIT_TEST(testLength); + CPPUNIT_TEST(testGetTempDir); + CPPUNIT_TEST_SUITE_END(); public: - void setUp (); + void setUp(); protected: - void testInit (); - void testSplit (); - void testAddComponent (); - void testCopy (); - void testIsUrl (); - void testSubstr (); - void testUnescape (); - void testLength (); - void testGetTempDir (); + void testInit(); + void testSplit(); + void testAddComponent(); + void testCopy(); + void testIsUrl(); + void testSubstr(); + void testUnescape(); + void testLength(); + void testGetTempDir(); }; /* ----------------------------------------------------------------- diff --git a/src/tests/svncpp/test_url.cpp b/src/tests/svncpp/test_url.cpp index 3abbc794..d01b8f07 100644 --- a/src/tests/svncpp/test_url.cpp +++ b/src/tests/svncpp/test_url.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -29,29 +29,29 @@ //svncpp #include "svncpp/url.hpp" -CPPUNIT_TEST_SUITE_REGISTRATION (UrlTestCase); +CPPUNIT_TEST_SUITE_REGISTRATION(UrlTestCase); void -UrlTestCase::setUp () +UrlTestCase::setUp() { } void -UrlTestCase::testIsValid () +UrlTestCase::testIsValid() { - CPPUNIT_ASSERT (svn::Url::isValid ("my_repos/some/dummy/path") == 0); - CPPUNIT_ASSERT (svn::Url::isValid ("\\is that a path?/\\/") == 0); - CPPUNIT_ASSERT (svn::Url::isValid ("https://yahoo.de/index.de.html") == 1); - CPPUNIT_ASSERT (svn::Url::isValid ("file:///local/file/here") == 1); - CPPUNIT_ASSERT (svn::Url::isValid ("http://yahoo.de") == 1); + CPPUNIT_ASSERT(svn::Url::isValid("my_repos/some/dummy/path") == 0); + CPPUNIT_ASSERT(svn::Url::isValid("\\is that a path?/\\/") == 0); + CPPUNIT_ASSERT(svn::Url::isValid("https://yahoo.de/index.de.html") == 1); + CPPUNIT_ASSERT(svn::Url::isValid("file:///local/file/here") == 1); + CPPUNIT_ASSERT(svn::Url::isValid("http://yahoo.de") == 1); } void -UrlTestCase::testEscape () +UrlTestCase::testEscape() { - CPPUNIT_ASSERT ("http://tigris.org/x%20y%20z.html" == svn::Url::escape ("http://tigris.org/x y z.html")); - CPPUNIT_ASSERT ("http://tigris.org/xyz.php" == svn::Url::escape ("http://tigris.org/xyz.php")); - CPPUNIT_ASSERT ("file:///local/file/here" == svn::Url::escape ("file:///local/file/here")); + CPPUNIT_ASSERT("http://tigris.org/x%20y%20z.html" == svn::Url::escape("http://tigris.org/x y z.html")); + CPPUNIT_ASSERT("http://tigris.org/xyz.php" == svn::Url::escape("http://tigris.org/xyz.php")); + CPPUNIT_ASSERT("file:///local/file/here" == svn::Url::escape("file:///local/file/here")); } diff --git a/src/tests/svncpp/test_url.hpp b/src/tests/svncpp/test_url.hpp index 25e9ad9c..58d84dea 100644 --- a/src/tests/svncpp/test_url.hpp +++ b/src/tests/svncpp/test_url.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -29,17 +29,17 @@ */ class UrlTestCase : public CppUnit::TestCase { - CPPUNIT_TEST_SUITE (UrlTestCase); - CPPUNIT_TEST (testIsValid); - CPPUNIT_TEST (testEscape); - CPPUNIT_TEST_SUITE_END (); + CPPUNIT_TEST_SUITE(UrlTestCase); + CPPUNIT_TEST(testIsValid); + CPPUNIT_TEST(testEscape); + CPPUNIT_TEST_SUITE_END(); public: - void setUp (); + void setUp(); protected: - void testIsValid (); - void testEscape (); + void testIsValid(); + void testEscape(); }; /* ----------------------------------------------------------------- diff --git a/src/threaded_worker.cpp b/src/threaded_worker.cpp index 1716d033..938523f9 100644 --- a/src/threaded_worker.cpp +++ b/src/threaded_worker.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -52,24 +52,24 @@ class ThreadedWorker::Data : public wxThread /** * constructor */ - Data (wxWindow * parent) + Data(wxWindow * parent) { - Init (parent); + Init(parent); } /** * destructor */ - virtual ~Data () + virtual ~Data() { - SetContext (0, false); + SetContext(0, false); } /** * initialize values */ void - Init (wxWindow * parent) + Init(wxWindow * parent) { this->parent = parent; context = 0; @@ -81,7 +81,7 @@ class ThreadedWorker::Data : public wxThread //if (Create () != wxTHREAD_NO_ERROR) // TODO: error handling - Create (); + Create(); Run(); } @@ -93,7 +93,7 @@ class ThreadedWorker::Data : public wxThread * @param own own new context */ void - SetContext (svn::Context * ctx, bool own) + SetContext(svn::Context * ctx, bool own) { if (own && (ownContext != 0)) { @@ -111,19 +111,19 @@ class ThreadedWorker::Data : public wxThread virtual void * Entry() { - while (!TestDestroy ()) + while (!TestDestroy()) { - ExecuteAction (); + ExecuteAction(); - Sleep (10); + Sleep(10); } return 0; } void - DeleteAction () + DeleteAction() { - ActionEvent::Post (parent, TOKEN_DELETE_ACTION, (void*)action); + ActionEvent::Post(parent, TOKEN_DELETE_ACTION, (void*)action); action = 0; } @@ -131,19 +131,19 @@ class ThreadedWorker::Data : public wxThread * executes the action if there is any */ void - ExecuteAction () + ExecuteAction() { if (action == 0) return; - ActionEvent event (parent, TOKEN_ACTION_START); + ActionEvent event(parent, TOKEN_ACTION_START); { wxString msg; - msg.Printf (_("Execute: %s"), actionName.c_str ()); + msg.Printf(_("Execute: %s"), actionName.c_str()); - event.init (parent, TOKEN_ACTION_START, msg); - event.Post (); + event.init(parent, TOKEN_ACTION_START, msg); + event.Post(); } unsigned int actionFlags = 0; @@ -151,44 +151,44 @@ class ThreadedWorker::Data : public wxThread try { state = ACTION_RUNNING; - if (!action->Perform ()) + if (!action->Perform()) result = ACTION_ERROR; else result = ACTION_SUCCESS; - actionFlags = action->GetFlags (); + actionFlags = action->GetFlags(); state = ACTION_NONE; } catch (svn::ClientException & e) { - wxString msg, errtxt (Utf8ToLocal (e.message ())); - msg.Printf (_("Error while performing action: %s"), - errtxt.c_str ()); + wxString msg, errtxt(Utf8ToLocal(e.message())); + msg.Printf(_("Error while performing action: %s"), + errtxt.c_str()); - event.init (parent, TOKEN_SVN_INTERNAL_ERROR, msg); - event.Post (); + event.init(parent, TOKEN_SVN_INTERNAL_ERROR, msg); + event.Post(); state = ACTION_NONE; result = ACTION_ERROR; - DeleteAction (); + DeleteAction(); return; } catch (...) { - wxString msg (_("Error while performing action.")); + wxString msg(_("Error while performing action.")); - event.init (parent, TOKEN_SVN_INTERNAL_ERROR, msg); - event.Post (); + event.init(parent, TOKEN_SVN_INTERNAL_ERROR, msg); + event.Post(); state = ACTION_NONE; result = ACTION_ERROR; - DeleteAction (); + DeleteAction(); return; } - event.init (parent, TOKEN_ACTION_END, (void*) new unsigned int(actionFlags)); - event.Post (); - DeleteAction (); + event.init(parent, TOKEN_ACTION_END, (void*) new unsigned int(actionFlags)); + event.Post(); + DeleteAction(); } /** @@ -201,67 +201,67 @@ class ThreadedWorker::Data : public wxThread } void - TraceError (const wxString & message) + TraceError(const wxString & message) { if (tracer) - tracer->TraceError (message); + tracer->TraceError(message); } }; -ThreadedWorker::ThreadedWorker (wxWindow * parent) +ThreadedWorker::ThreadedWorker(wxWindow * parent) { - m = new Data (parent); + m = new Data(parent); } -ThreadedWorker::~ThreadedWorker () +ThreadedWorker::~ThreadedWorker() { - m->Delete (); + m->Delete(); } void -ThreadedWorker::Create (wxWindow * parent) +ThreadedWorker::Create(wxWindow * parent) { - m->Init (parent); + m->Init(parent); } ActionState -ThreadedWorker::GetState () +ThreadedWorker::GetState() { return m->state; } ActionResult -ThreadedWorker::GetResult () +ThreadedWorker::GetResult() { return m->result; } bool -ThreadedWorker::Perform (Action * action_) +ThreadedWorker::Perform(Action * action_) { // is there already a thread running? if (m->action != 0) { - m->TraceError (_("Internal Error: There is another action running")); + m->TraceError(_("Internal Error: There is another action running")); return false; } // is there a context? we need one if (m->context == 0) { - m->TraceError (_("Internal Error: no context available")); + m->TraceError(_("Internal Error: no context available")); return false; } - action_->SetContext (m->context); - m->context->reset (); + action_->SetContext(m->context); + m->context->reset(); m->result = ACTION_NOTHING; m->state = ACTION_INIT; try { - if (!action_->Prepare ()) + if (!action_->Prepare()) { m->result = ACTION_ABORTED; m->state = ACTION_NONE; @@ -272,9 +272,9 @@ ThreadedWorker::Perform (Action * action_) } catch (svn::ClientException & e) { - wxString msg, errtxt (Utf8ToLocal (e.message ())); - msg.Printf ( _("Error while preparing action: %s"), errtxt.c_str () ); - m->TraceError (msg); + wxString msg, errtxt(Utf8ToLocal(e.message())); + msg.Printf(_("Error while preparing action: %s"), errtxt.c_str()); + m->TraceError(msg); m->result = ACTION_ERROR; m->state = ACTION_NONE; @@ -283,7 +283,7 @@ ThreadedWorker::Perform (Action * action_) } catch (...) { - m->TraceError (_("Error while preparing action.")); + m->TraceError(_("Error while preparing action.")); m->result = ACTION_ERROR; m->state = ACTION_NONE; @@ -291,26 +291,26 @@ ThreadedWorker::Perform (Action * action_) return false; } - m->actionName = action_->GetName (); + m->actionName = action_->GetName(); m->action = action_; return true; } void -ThreadedWorker::SetTracer (Tracer * tracer) +ThreadedWorker::SetTracer(Tracer * tracer) { m->tracer = tracer; } void -ThreadedWorker::SetContext (svn::Context * context, bool own) +ThreadedWorker::SetContext(svn::Context * context, bool own) { - m->SetContext (context, own); + m->SetContext(context, own); } svn::Context * -ThreadedWorker::GetContext () const +ThreadedWorker::GetContext() const { return m->context; } diff --git a/src/threaded_worker.hpp b/src/threaded_worker.hpp index 33c81378..50f0ecd3 100644 --- a/src/threaded_worker.hpp +++ b/src/threaded_worker.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,53 +37,53 @@ class ThreadedWorker : public ActionWorker /** * default constructor. */ - ThreadedWorker (wxWindow * parent = 0); + ThreadedWorker(wxWindow * parent = 0); /** * destructor */ - virtual ~ThreadedWorker (); + virtual ~ThreadedWorker(); /** * @see ActionWorker */ - virtual void - Create (wxWindow * parent); + virtual void + Create(wxWindow * parent); /** * @see ActionWorker */ - virtual ActionState - GetState (); + virtual ActionState + GetState(); /** * @see ActionWorker */ - virtual ActionResult - GetResult (); + virtual ActionResult + GetResult(); /** * @see ActionWorker */ - virtual void SetTracer (Tracer * tr); + virtual void SetTracer(Tracer * tr); /** * @see ActionWorker */ - virtual bool - Perform (Action * action); + virtual bool + Perform(Action * action); /** * @see ActionWorker */ virtual void - SetContext (svn::Context * context, bool own = false); + SetContext(svn::Context * context, bool own = false); /** * @see ActionWorker */ - virtual svn::Context * - GetContext () const; + virtual svn::Context * + GetContext() const; private: class Data; @@ -92,7 +92,7 @@ class ThreadedWorker : public ActionWorker /** * disallow private copy constructor */ - ThreadedWorker (const ThreadedWorker &); + ThreadedWorker(const ThreadedWorker &); }; #endif diff --git a/src/trace_update.cpp b/src/trace_update.cpp index 47733694..5ffa54bf 100644 --- a/src/trace_update.cpp +++ b/src/trace_update.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -72,12 +72,12 @@ struct FileBaton */ static DirBaton * -make_dir_baton (const char *path, - void *edit_baton, void *parent_dir_baton, apr_pool_t * pool) +make_dir_baton(const char *path, + void *edit_baton, void *parent_dir_baton, apr_pool_t * pool) { EditBaton *eb = (EditBaton *) edit_baton; DirBaton *pb = (DirBaton *) parent_dir_baton; - DirBaton *new_db = (DirBaton *) apr_pcalloc (pool, sizeof (*new_db)); + DirBaton *new_db = (DirBaton *) apr_pcalloc(pool, sizeof(*new_db)); const char *full_path; // A path relative to nothing @@ -85,9 +85,9 @@ make_dir_baton (const char *path, return NULL; if (pb) - full_path = svn_path_join (eb->path, path, pool); + full_path = svn_path_join(eb->path, path, pool); else - full_path = apr_pstrdup (pool, eb->path); + full_path = apr_pstrdup(pool, eb->path); new_db->edit_baton = eb; new_db->parent_baton = pb; @@ -97,14 +97,14 @@ make_dir_baton (const char *path, } static FileBaton * -make_file_baton (const char *path, - void *parent_dir_baton, - svn_boolean_t added, apr_pool_t * pool) +make_file_baton(const char *path, + void *parent_dir_baton, + svn_boolean_t added, apr_pool_t * pool) { DirBaton *pb = (DirBaton *) parent_dir_baton; EditBaton *eb = pb->edit_baton; - FileBaton *new_fb = (FileBaton *) apr_pcalloc (pool, sizeof (FileBaton)); - const char *full_path = svn_path_join (eb->path, path, pool); + FileBaton *new_fb = (FileBaton *) apr_pcalloc(pool, sizeof(FileBaton)); + const char *full_path = svn_path_join(eb->path, path, pool); new_fb->edit_baton = eb; new_fb->parent_baton = pb; @@ -121,15 +121,15 @@ make_file_baton (const char *path, */ static svn_error_t * -open_root (void *edit_baton, - svn_revnum_t base_revision, apr_pool_t * pool, void **root_baton) +open_root(void *edit_baton, + svn_revnum_t base_revision, apr_pool_t * pool, void **root_baton) { - *root_baton = make_dir_baton (NULL, edit_baton, NULL, pool); + *root_baton = make_dir_baton(NULL, edit_baton, NULL, pool); return SVN_NO_ERROR; } static svn_error_t * -set_target_revision (void *edit_baton, svn_revnum_t target_revision, apr_pool_t *) +set_target_revision(void *edit_baton, svn_revnum_t target_revision, apr_pool_t *) { EditBaton *eb = (EditBaton *) edit_baton; @@ -138,36 +138,36 @@ set_target_revision (void *edit_baton, svn_revnum_t target_revision, apr_pool_t } static svn_error_t * -open_directory (const char *path, - void *parent_baton, - svn_revnum_t base_revision, - apr_pool_t * pool, void **child_baton) +open_directory(const char *path, + void *parent_baton, + svn_revnum_t base_revision, + apr_pool_t * pool, void **child_baton) { DirBaton *pb = (DirBaton *) parent_baton; EditBaton *eb = pb->edit_baton; - DirBaton *new_db = make_dir_baton (path, eb, pb, pool); + DirBaton *new_db = make_dir_baton(path, eb, pb, pool); *child_baton = new_db; return SVN_NO_ERROR; } static svn_error_t * -add_directory (const char *path, - void *parent_baton, - const char *copyfrom_path, - svn_revnum_t copyfrom_revision, - apr_pool_t * pool, void **child_baton) +add_directory(const char *path, + void *parent_baton, + const char *copyfrom_path, + svn_revnum_t copyfrom_revision, + apr_pool_t * pool, void **child_baton) { DirBaton *pb = (DirBaton *) parent_baton; EditBaton *eb = pb->edit_baton; - DirBaton *new_db = make_dir_baton (path, eb, pb, pool); + DirBaton *new_db = make_dir_baton(path, eb, pb, pool); eb->changed = TRUE; { - wxString wxpath (Utf8ToLocal (new_db->path)); - wxString str = wxString::Format (wxT("A %s"), wxpath.c_str ()); - eb->tracer->Trace (str); + wxString wxpath(Utf8ToLocal(new_db->path)); + wxString str = wxString::Format(wxT("A %s"), wxpath.c_str()); + eb->tracer->Trace(str); } *child_baton = new_db; @@ -175,7 +175,7 @@ add_directory (const char *path, } static svn_error_t * -close_directory (void *dir_baton, apr_pool_t *) +close_directory(void *dir_baton, apr_pool_t *) { DirBaton *db = (DirBaton *) dir_baton; EditBaton *eb = db->edit_baton; @@ -186,19 +186,19 @@ close_directory (void *dir_baton, apr_pool_t *) // Check for conflicted state. const svn_wc_entry_t *entry; svn_boolean_t merged, tc, pc; - apr_pool_t *subpool = svn_pool_create (eb->pool); + apr_pool_t *subpool = svn_pool_create(eb->pool); svn_wc_adm_access_t *adm_access; - SVN_ERR (svn_wc_adm_probe_open (&adm_access, NULL, db->path, FALSE, - FALSE, subpool)); + SVN_ERR(svn_wc_adm_probe_open(&adm_access, NULL, db->path, FALSE, + FALSE, subpool)); - SVN_ERR (svn_wc_entry (&entry, db->path, adm_access, FALSE, subpool)); - SVN_ERR (svn_wc_conflicted_p (&tc, &pc, db->path, entry, subpool)); + SVN_ERR(svn_wc_entry(&entry, db->path, adm_access, FALSE, subpool)); + SVN_ERR(svn_wc_conflicted_p(&tc, &pc, db->path, entry, subpool)); if (!pc) { - SVN_ERR (svn_wc_props_modified_p (&merged, db->path, - adm_access, subpool)); + SVN_ERR(svn_wc_props_modified_p(&merged, db->path, + adm_access, subpool)); } if (pc) @@ -208,26 +208,26 @@ close_directory (void *dir_baton, apr_pool_t *) else statchar_buf[1] = wxT('U'); { - wxString wxpath (Utf8ToLocal (db->path)); - wxString str = wxString::Format (wxT("%s %s"), statchar_buf, wxpath.c_str ()); - eb->tracer->Trace (str); + wxString wxpath(Utf8ToLocal(db->path)); + wxString str = wxString::Format(wxT("%s %s"), statchar_buf, wxpath.c_str()); + eb->tracer->Trace(str); } /* Destroy the subpool. */ - svn_pool_destroy (subpool); + svn_pool_destroy(subpool); } return SVN_NO_ERROR; } static svn_error_t * -open_file (const char *path, - void *parent_baton, - svn_revnum_t ancestor_revision, - apr_pool_t * pool, void **file_baton) +open_file(const char *path, + void *parent_baton, + svn_revnum_t ancestor_revision, + apr_pool_t * pool, void **file_baton) { DirBaton *pb = (DirBaton *) parent_baton; - FileBaton *new_fb = make_file_baton (path, pb, FALSE, pool); + FileBaton *new_fb = make_file_baton(path, pb, FALSE, pool); *file_baton = new_fb; @@ -235,14 +235,14 @@ open_file (const char *path, } static svn_error_t * -add_file (const char *path, - void *parent_baton, - const char *copyfrom_path, - svn_revnum_t copyfrom_revision, - apr_pool_t * pool, void **file_baton) +add_file(const char *path, + void *parent_baton, + const char *copyfrom_path, + svn_revnum_t copyfrom_revision, + apr_pool_t * pool, void **file_baton) { DirBaton *pb = (DirBaton *) parent_baton; - FileBaton *new_fb = make_file_baton (path, pb, TRUE, pool); + FileBaton *new_fb = make_file_baton(path, pb, TRUE, pool); new_fb->edit_baton->changed = TRUE; *file_baton = new_fb; @@ -251,7 +251,7 @@ add_file (const char *path, } static svn_error_t * -close_file (void *file_baton, const char *, apr_pool_t *) +close_file(void *file_baton, const char *, apr_pool_t *) { FileBaton *fb = (FileBaton *) file_baton; EditBaton *eb = fb->edit_baton; @@ -267,21 +267,21 @@ close_file (void *file_baton, const char *, apr_pool_t *) /* First, check for conflicted state. */ const svn_wc_entry_t *entry; svn_boolean_t merged, tc, pc; - apr_pool_t *subpool = svn_pool_create (eb->pool); - const char *pdir = svn_path_dirname (fb->path, subpool); + apr_pool_t *subpool = svn_pool_create(eb->pool); + const char *pdir = svn_path_dirname(fb->path, subpool); svn_wc_adm_access_t *adm_access; - SVN_ERR (svn_wc_adm_probe_open (&adm_access, NULL, fb->path, FALSE, - FALSE, subpool)); + SVN_ERR(svn_wc_adm_probe_open(&adm_access, NULL, fb->path, FALSE, + FALSE, subpool)); - SVN_ERR (svn_wc_entry (&entry, fb->path, adm_access, FALSE, subpool)); + SVN_ERR(svn_wc_entry(&entry, fb->path, adm_access, FALSE, subpool)); if (entry) { - SVN_ERR (svn_wc_conflicted_p (&tc, &pc, pdir, entry, subpool)); + SVN_ERR(svn_wc_conflicted_p(&tc, &pc, pdir, entry, subpool)); if (fb->text_changed) { if (!tc) - SVN_ERR (svn_wc_text_modified_p (&merged, fb->path, TRUE, adm_access, subpool)); + SVN_ERR(svn_wc_text_modified_p(&merged, fb->path, TRUE, adm_access, subpool)); if (tc) statchar_buf[0] = wxT('C'); @@ -294,7 +294,7 @@ close_file (void *file_baton, const char *, apr_pool_t *) if (fb->prop_changed) { if (!pc) - SVN_ERR (svn_wc_props_modified_p (&merged, fb->path, NULL, subpool)); + SVN_ERR(svn_wc_props_modified_p(&merged, fb->path, NULL, subpool)); if (pc) statchar_buf[1] = wxT('C'); @@ -306,26 +306,26 @@ close_file (void *file_baton, const char *, apr_pool_t *) } /* Destroy the subpool. */ - svn_pool_destroy (subpool); + svn_pool_destroy(subpool); } { - wxString wxpath (Utf8ToLocal (fb->path)); - wxString str = wxString::Format (wxT("%s %s"), statchar_buf, wxpath.c_str ()); - eb->tracer->Trace (str); + wxString wxpath(Utf8ToLocal(fb->path)); + wxString str = wxString::Format(wxT("%s %s"), statchar_buf, wxpath.c_str()); + eb->tracer->Trace(str); } return SVN_NO_ERROR; } static svn_error_t * -change_file_prop (void *file_baton, - const char *name, - const svn_string_t * value, apr_pool_t * pool) +change_file_prop(void *file_baton, + const char *name, + const svn_string_t * value, apr_pool_t * pool) { FileBaton *fb = (FileBaton *) file_baton; - if (svn_wc_is_normal_prop (name)) + if (svn_wc_is_normal_prop(name)) { fb->prop_changed = TRUE; fb->edit_baton->changed = TRUE; @@ -335,13 +335,13 @@ change_file_prop (void *file_baton, } static svn_error_t * -change_dir_prop (void *parent_baton, - const char *name, - const svn_string_t * value, apr_pool_t * pool) +change_dir_prop(void *parent_baton, + const char *name, + const svn_string_t * value, apr_pool_t * pool) { DirBaton *db = (DirBaton *) parent_baton; - if (svn_wc_is_normal_prop (name)) + if (svn_wc_is_normal_prop(name)) { db->prop_changed = TRUE; db->edit_baton->changed = TRUE; @@ -351,8 +351,8 @@ change_dir_prop (void *parent_baton, } static svn_error_t * -delete_entry (const char *path, - svn_revnum_t revision, void *parent_baton, apr_pool_t * pool) +delete_entry(const char *path, + svn_revnum_t revision, void *parent_baton, apr_pool_t * pool) { DirBaton *pb = (DirBaton *) parent_baton; EditBaton *eb = pb->edit_baton; @@ -360,17 +360,17 @@ delete_entry (const char *path, eb->changed = TRUE; { - wxString wxpath (Utf8ToLocal (svn_path_join (eb->path, path, pool))); + wxString wxpath(Utf8ToLocal(svn_path_join(eb->path, path, pool))); wxString str = - wxString::Format (wxT("D %s"), wxpath.c_str ()); - eb->tracer->Trace (str); + wxString::Format(wxT("D %s"), wxpath.c_str()); + eb->tracer->Trace(str); } return SVN_NO_ERROR; } static svn_error_t * -apply_textdelta (void *file_baton, const char *, apr_pool_t *, - svn_txdelta_window_handler_t * handler, void **handler_baton) +apply_textdelta(void *file_baton, const char *, apr_pool_t *, + svn_txdelta_window_handler_t * handler, void **handler_baton) { FileBaton *fb = (FileBaton *) file_baton; @@ -383,7 +383,7 @@ apply_textdelta (void *file_baton, const char *, apr_pool_t *, } static svn_error_t * -close_edit (void *edit_baton, apr_pool_t *) +close_edit(void *edit_baton, apr_pool_t *) { EditBaton *eb = (EditBaton *) edit_baton; @@ -392,55 +392,55 @@ close_edit (void *edit_baton, apr_pool_t *) if (eb->is_checkout) { wxString str = - wxString::Format (wxT("Checked out revision %") - wxT(SVN_REVNUM_T_FMT) - wxT("."), - eb->revision); - eb->tracer->Trace (str); + wxString::Format(wxT("Checked out revision %") + wxT(SVN_REVNUM_T_FMT) + wxT("."), + eb->revision); + eb->tracer->Trace(str); } else { if (eb->changed) { wxString str = - wxString::Format (wxT("Updated to revision %") - wxT(SVN_REVNUM_T_FMT) - wxT("."), - eb->revision); - eb->tracer->Trace (str); + wxString::Format(wxT("Updated to revision %") + wxT(SVN_REVNUM_T_FMT) + wxT("."), + eb->revision); + eb->tracer->Trace(str); } else { - wxString str = wxString::Format (wxT("At revision %") - wxT(SVN_REVNUM_T_FMT) - wxT("."), - eb->revision); - eb->tracer->Trace (str); + wxString str = wxString::Format(wxT("At revision %") + wxT(SVN_REVNUM_T_FMT) + wxT("."), + eb->revision); + eb->tracer->Trace(str); } } } - svn_pool_destroy (eb->pool); + svn_pool_destroy(eb->pool); return SVN_NO_ERROR; } svn_error_t * -get_trace_update_editor (const svn_delta_editor_t ** editor, - void **edit_baton, - const char *initial_path, - svn_boolean_t is_checkout, - svn_boolean_t no_final_line, - Tracer * tracer, apr_pool_t * pool) +get_trace_update_editor(const svn_delta_editor_t ** editor, + void **edit_baton, + const char *initial_path, + svn_boolean_t is_checkout, + svn_boolean_t no_final_line, + Tracer * tracer, apr_pool_t * pool) { - apr_pool_t *subpool = svn_pool_create (pool); - EditBaton *eb = (EditBaton *) apr_pcalloc (subpool, sizeof (EditBaton)); - svn_delta_editor_t *te = svn_delta_default_editor (pool); + apr_pool_t *subpool = svn_pool_create(pool); + EditBaton *eb = (EditBaton *) apr_pcalloc(subpool, sizeof(EditBaton)); + svn_delta_editor_t *te = svn_delta_default_editor(pool); // Set up the edit context. eb->pool = subpool; - eb->path = apr_pstrdup (subpool, initial_path); + eb->path = apr_pstrdup(subpool, initial_path); eb->revision = SVN_INVALID_REVNUM; eb->is_checkout = is_checkout; eb->tracer = tracer; diff --git a/src/trace_update.hpp b/src/trace_update.hpp index 19c6e739..7e7ef9ca 100644 --- a/src/trace_update.hpp +++ b/src/trace_update.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,12 +34,12 @@ // forward declarations class Tracer; -svn_error_t *get_trace_update_editor (const svn_delta_editor_t ** editor, - void **edit_baton, - const char *initial_path, - svn_boolean_t is_checkout, - svn_boolean_t no_final_line, - Tracer * tracer, apr_pool_t * pool); +svn_error_t *get_trace_update_editor(const svn_delta_editor_t ** editor, + void **edit_baton, + const char *initial_path, + svn_boolean_t is_checkout, + svn_boolean_t no_final_line, + Tracer * tracer, apr_pool_t * pool); #endif /* ----------------------------------------------------------------- diff --git a/src/tracer.cpp b/src/tracer.cpp index c22dd6d9..423a2bdf 100644 --- a/src/tracer.cpp +++ b/src/tracer.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -30,21 +30,21 @@ #include "ids.hpp" #include "tracer.hpp" -EventTracer::EventTracer (wxFrame * fr) - : m_frame (fr) +EventTracer::EventTracer(wxFrame * fr) + : m_frame(fr) { } void -EventTracer::Trace (const wxString & msg) +EventTracer::Trace(const wxString & msg) { - ActionEvent::Post (m_frame, TOKEN_INFO, msg); + ActionEvent::Post(m_frame, TOKEN_INFO, msg); } void -EventTracer::TraceError (const wxString & msg) +EventTracer::TraceError(const wxString & msg) { - ActionEvent::Post (m_frame, TOKEN_ERROR, msg); + ActionEvent::Post(m_frame, TOKEN_ERROR, msg); } /* ----------------------------------------------------------------- diff --git a/src/tracer.hpp b/src/tracer.hpp index 7b235ce0..c7e3e9fb 100644 --- a/src/tracer.hpp +++ b/src/tracer.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -40,9 +40,9 @@ class wxString; class Tracer { public: - virtual void Trace (const wxString &) = 0; - virtual void TraceError (const wxString &) = 0; - virtual ~Tracer () { } + virtual void Trace(const wxString &) = 0; + virtual void TraceError(const wxString &) = 0; + virtual ~Tracer() { } }; /** @@ -54,10 +54,10 @@ class EventTracer : public Tracer wxFrame * m_frame; public: - EventTracer (wxFrame * fr); + EventTracer(wxFrame * fr); - void Trace (const wxString & msg); - void TraceError (const wxString & msg); + void Trace(const wxString & msg); + void TraceError(const wxString & msg); }; #endif diff --git a/src/unlock_action.cpp b/src/unlock_action.cpp index acb14694..ffd76960 100644 --- a/src/unlock_action.cpp +++ b/src/unlock_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,45 +35,45 @@ #include "ids.hpp" #include "utils.hpp" -UnlockAction::UnlockAction (wxWindow * parent) - : Action (parent, _("Unlock")) +UnlockAction::UnlockAction(wxWindow * parent) + : Action(parent, _("Unlock")) { } bool -UnlockAction::Prepare () +UnlockAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - UnlockDlg dlg(GetParent ()); + UnlockDlg dlg(GetParent()); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - m_force = dlg.GetForce (); + m_force = dlg.GetForce(); return true; } bool -UnlockAction::Perform () +UnlockAction::Perform() { - svn::Client client (GetContext ()); + svn::Client client(GetContext()); - const svn::Targets & statusSel = GetTargets (); + const svn::Targets & statusSel = GetTargets(); - client.unlock (statusSel, m_force); + client.unlock(statusSel, m_force); return true; } bool -UnlockAction::CheckStatusSel (const svn::StatusSel & statusSel) +UnlockAction::CheckStatusSel(const svn::StatusSel & statusSel) { return true; } diff --git a/src/unlock_action.hpp b/src/unlock_action.hpp index 4d1338ea..65cf4956 100644 --- a/src/unlock_action.hpp +++ b/src/unlock_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,23 +36,23 @@ namespace svn class UnlockAction : public Action { public: - UnlockAction (wxWindow * parent); + UnlockAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: bool m_force; // hide default and copy constructor - UnlockAction (); - UnlockAction (const UnlockAction &); + UnlockAction(); + UnlockAction(const UnlockAction &); }; #endif diff --git a/src/unlock_dlg.cpp b/src/unlock_dlg.cpp index b7591356..f220f522 100644 --- a/src/unlock_dlg.cpp +++ b/src/unlock_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,63 +34,63 @@ struct UnlockDlg::Data public: bool force; - Data (wxWindow * window) - : force (false) + Data(wxWindow * window) + : force(false) { wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer * topSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer * buttonSizer = new wxBoxSizer(wxHORIZONTAL); wxStaticText * label = - new wxStaticText (window, -1, _("Do you want to unlock the selected files/directories?")); - topSizer->Add (label, 0, wxALL, 5); + new wxStaticText(window, -1, _("Do you want to unlock the selected files/directories?")); + topSizer->Add(label, 0, wxALL, 5); // The "force" check box: wxCheckBox * check = - new wxCheckBox (window, -1, - _("Force unlocking even if you are not the lock owner"), - wxDefaultPosition, wxDefaultSize, 0, - wxGenericValidator(&force)); + new wxCheckBox(window, -1, + _("Force unlocking even if you are not the lock owner"), + wxDefaultPosition, wxDefaultSize, 0, + wxGenericValidator(&force)); // The buttons: - wxButton * ok = new wxButton (window, wxID_OK, _("OK" )); - buttonSizer->Add (ok, 0, wxALL, 10); + wxButton * ok = new wxButton(window, wxID_OK, _("OK")); + buttonSizer->Add(ok, 0, wxALL, 10); - wxButton * cancel = new wxButton (window, wxID_CANCEL, _("Cancel")); - buttonSizer->Add (cancel, 0, wxALL, 10); + wxButton * cancel = new wxButton(window, wxID_CANCEL, _("Cancel")); + buttonSizer->Add(cancel, 0, wxALL, 10); // Add all the sizers to the main sizer - mainSizer->Add (topSizer, 1, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (check, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5); - mainSizer->Add (buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); + mainSizer->Add(topSizer, 1, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(check, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5); + mainSizer->Add(buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); - window->SetAutoLayout (true); - window->SetSizer (mainSizer); + window->SetAutoLayout(true); + window->SetSizer(mainSizer); - mainSizer->SetSizeHints (window); - mainSizer->Fit (window); + mainSizer->SetSizeHints(window); + mainSizer->Fit(window); - ok->SetDefault (); + ok->SetDefault(); } }; -BEGIN_EVENT_TABLE (UnlockDlg, wxDialog) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(UnlockDlg, wxDialog) +END_EVENT_TABLE() -UnlockDlg::UnlockDlg (wxWindow * parent) - : wxDialog (parent, -1, _("Unlock"), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +UnlockDlg::UnlockDlg(wxWindow * parent) + : wxDialog(parent, -1, _("Unlock"), + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - m = new Data (this); + m = new Data(this); } -UnlockDlg::~UnlockDlg () +UnlockDlg::~UnlockDlg() { delete m; } bool -UnlockDlg::GetForce () const +UnlockDlg::GetForce() const { return m->force; } diff --git a/src/unlock_dlg.hpp b/src/unlock_dlg.hpp index bb098d1c..b937944d 100644 --- a/src/unlock_dlg.hpp +++ b/src/unlock_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -32,16 +32,16 @@ class UnlockDlg:public wxDialog public: UnlockDlg(wxWindow* parent); - virtual ~UnlockDlg (); + virtual ~UnlockDlg(); bool - GetForce () const; + GetForce() const; private: struct Data; Data * m; - DECLARE_EVENT_TABLE () + DECLARE_EVENT_TABLE() }; #endif diff --git a/src/update_action.cpp b/src/update_action.cpp index 7084fcd9..6e9a1cd9 100644 --- a/src/update_action.cpp +++ b/src/update_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,68 +35,68 @@ #include "update_dlg.hpp" #include "utils.hpp" -UpdateAction::UpdateAction (wxWindow * parent) - : Action (parent, _("Update")) +UpdateAction::UpdateAction(wxWindow * parent) + : Action(parent, _("Update")) { } bool -UpdateAction::Prepare () +UpdateAction::Prepare() { - if (!Action::Prepare ()) + if (!Action::Prepare()) { return false; } - UpdateDlg dlg (GetParent (), _("Update")); + UpdateDlg dlg(GetParent(), _("Update")); - if (dlg.ShowModal () != wxID_OK) + if (dlg.ShowModal() != wxID_OK) { return false; } - m_data = dlg.GetData (); + m_data = dlg.GetData(); return true; } bool -UpdateAction::Perform () +UpdateAction::Perform() { - svn::Revision revision (svn::Revision::HEAD); + svn::Revision revision(svn::Revision::HEAD); // Did the user request a specific revision?: if (!m_data.useLatest) { TrimString(m_data.revision); - if (!m_data.revision.IsEmpty ()) + if (!m_data.revision.IsEmpty()) { svn_revnum_t revnum; m_data.revision.ToLong(&revnum, 10); // If this fails, revnum is unchanged. - revision = svn::Revision (revnum); + revision = svn::Revision(revnum); } } - wxSetWorkingDirectory (Utf8ToLocal (GetPath ().c_str ())); - svn::Client client (GetContext ()); + wxSetWorkingDirectory(Utf8ToLocal(GetPath().c_str())); + svn::Client client(GetContext()); - client.update (GetTargets (), revision, m_data.recursive, - m_data.ignoreExternals); + client.update(GetTargets(), revision, m_data.recursive, + m_data.ignoreExternals); return true; } bool -UpdateAction::CheckStatusSel (const svn::StatusSel & statusSel) +UpdateAction::CheckStatusSel(const svn::StatusSel & statusSel) { // no Update for repositories - if (statusSel.hasUrl ()) + if (statusSel.hasUrl()) return false; // we NEED statusSel - if (0 == statusSel.size ()) + if (0 == statusSel.size()) return false; // No unversioned files allowed - if (statusSel.hasUnversioned ()) + if (statusSel.hasUnversioned()) return false; return true; diff --git a/src/update_action.hpp b/src/update_action.hpp index ad4d473b..2f3fe50a 100644 --- a/src/update_action.hpp +++ b/src/update_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -37,16 +37,16 @@ namespace svn class UpdateAction:public Action { public: - UpdateAction (wxWindow * parent); + UpdateAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: UpdateData m_data; diff --git a/src/update_data.hpp b/src/update_data.hpp index 059a1738..4439a24f 100644 --- a/src/update_data.hpp +++ b/src/update_data.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -30,8 +30,8 @@ struct UpdateData { UpdateData() - : revision (wxEmptyString), url (wxEmptyString), - useLatest (true), recursive (true), ignoreExternals (false) + : revision(wxEmptyString), url(wxEmptyString), + useLatest(true), recursive(true), ignoreExternals(false) { } diff --git a/src/update_dlg.cpp b/src/update_dlg.cpp index c4f159e9..4410e73e 100644 --- a/src/update_dlg.cpp +++ b/src/update_dlg.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -56,90 +56,90 @@ struct UpdateDlg::Data public: UpdateData data; - Data (wxWindow * window, int flags, bool recursive) - : m_textRevision (0), m_checkUseLatest (0), m_comboUrl (0), - m_buttonOk (0), m_flags (flags) + Data(wxWindow * window, int flags, bool recursive) + : m_textRevision(0), m_checkUseLatest(0), m_comboUrl(0), + m_buttonOk(0), m_flags(flags) { data.recursive = recursive; - wxBoxSizer *mainSizer = new wxBoxSizer (wxVERTICAL); - wxBoxSizer *middleSizer = new wxBoxSizer (wxVERTICAL); - wxBoxSizer *optionSizer = new wxBoxSizer (wxHORIZONTAL); - wxBoxSizer *buttonSizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); + wxBoxSizer *middleSizer = new wxBoxSizer(wxVERTICAL); + wxBoxSizer *optionSizer = new wxBoxSizer(wxHORIZONTAL); + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); // The URL fields: - if (withUrl ()) + if (withUrl()) { - wxStaticBox * box = new wxStaticBox (window, -1, _("URL")); - wxStaticBoxSizer * sizer = new wxStaticBoxSizer (box, wxHORIZONTAL); + wxStaticBox * box = new wxStaticBox(window, -1, _("URL")); + wxStaticBoxSizer * sizer = new wxStaticBoxSizer(box, wxHORIZONTAL); - HistoryValidator val (HISTORY_REPOSITORY, &data.url); - m_comboUrl = new wxComboBox (window, ID_URL, wxEmptyString, - wxDefaultPosition, wxSize (235, -1), - 0, 0, wxCB_DROPDOWN, val); + HistoryValidator val(HISTORY_REPOSITORY, &data.url); + m_comboUrl = new wxComboBox(window, ID_URL, wxEmptyString, + wxDefaultPosition, wxSize(235, -1), + 0, 0, wxCB_DROPDOWN, val); - sizer->Add (m_comboUrl, 1, wxALL | wxEXPAND, 5); - middleSizer->Add (sizer, 1, wxALL | wxEXPAND, 5); + sizer->Add(m_comboUrl, 1, wxALL | wxEXPAND, 5); + middleSizer->Add(sizer, 1, wxALL | wxEXPAND, 5); } // The revision fields: - if (withRevision ()) + if (withRevision()) { - wxStaticBox * box = new wxStaticBox (window, -1, _("Revision")); - wxStaticBoxSizer *revSizer = new wxStaticBoxSizer (box, wxHORIZONTAL); - - wxTextValidator val (wxFILTER_NUMERIC, &data.revision); - m_textRevision = new wxTextCtrl (window, ID_REVISION, wxEmptyString, - wxDefaultPosition, - wxDefaultSize, 0, val); - revSizer->Add (m_textRevision, 1, - wxALL | wxALIGN_CENTER_VERTICAL | wxEXPAND, 5); - - wxGenericValidator valUseLatest (&data.useLatest); - m_checkUseLatest = new wxCheckBox (window, ID_USELATEST, - _("Use latest"), - wxDefaultPosition, - wxDefaultSize, 0, valUseLatest); - revSizer->Add (m_checkUseLatest, 0, - wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); - - middleSizer->Add (revSizer, 1, wxALL | wxEXPAND, 5); + wxStaticBox * box = new wxStaticBox(window, -1, _("Revision")); + wxStaticBoxSizer *revSizer = new wxStaticBoxSizer(box, wxHORIZONTAL); + + wxTextValidator val(wxFILTER_NUMERIC, &data.revision); + m_textRevision = new wxTextCtrl(window, ID_REVISION, wxEmptyString, + wxDefaultPosition, + wxDefaultSize, 0, val); + revSizer->Add(m_textRevision, 1, + wxALL | wxALIGN_CENTER_VERTICAL | wxEXPAND, 5); + + wxGenericValidator valUseLatest(&data.useLatest); + m_checkUseLatest = new wxCheckBox(window, ID_USELATEST, + _("Use latest"), + wxDefaultPosition, + wxDefaultSize, 0, valUseLatest); + revSizer->Add(m_checkUseLatest, 0, + wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); + + middleSizer->Add(revSizer, 1, wxALL | wxEXPAND, 5); } // The recursive checkbox - - if (withRecursive ()) + + if (withRecursive()) { - wxGenericValidator val (&data.recursive); + wxGenericValidator val(&data.recursive); wxCheckBox * checkRecursive = - new wxCheckBox (window, -1, _("Recursive"), - wxDefaultPosition, wxDefaultSize, 0, val); - optionSizer->Add (checkRecursive, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL , 5); + new wxCheckBox(window, -1, _("Recursive"), + wxDefaultPosition, wxDefaultSize, 0, val); + optionSizer->Add(checkRecursive, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL , 5); } // The "ignore externals" checkbox - wxGenericValidator valIgnoreExternals (&data.ignoreExternals); - m_checkIgnoreExternals = new wxCheckBox (window, ID_IGNOREEXTERNALS, - _("Ignore externals"), - wxDefaultPosition, - wxDefaultSize, 0, - valIgnoreExternals); - optionSizer->Add (m_checkIgnoreExternals, 0, - wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); + wxGenericValidator valIgnoreExternals(&data.ignoreExternals); + m_checkIgnoreExternals = new wxCheckBox(window, ID_IGNOREEXTERNALS, + _("Ignore externals"), + wxDefaultPosition, + wxDefaultSize, 0, + valIgnoreExternals); + optionSizer->Add(m_checkIgnoreExternals, 0, + wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); // The buttons: - m_buttonOk = new wxButton (window, wxID_OK, _("OK" )); - buttonSizer->Add (m_buttonOk, 0, wxALL, 10); - wxButton * button = new wxButton (window, wxID_CANCEL, _("Cancel")); - buttonSizer->Add (button, 0, wxALL, 10); + m_buttonOk = new wxButton(window, wxID_OK, _("OK")); + buttonSizer->Add(m_buttonOk, 0, wxALL, 10); + wxButton * button = new wxButton(window, wxID_CANCEL, _("Cancel")); + buttonSizer->Add(button, 0, wxALL, 10); // Add all the sizers to the main sizer - mainSizer->Add (middleSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (optionSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); - mainSizer->Add (5, 5, 1, wxEXPAND); - mainSizer->Add (buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); + mainSizer->Add(middleSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(optionSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 5); + mainSizer->Add(5, 5, 1, wxEXPAND); + mainSizer->Add(buttonSizer, 0, wxLEFT | wxRIGHT | wxCENTER, 5); window->SetAutoLayout(true); window->SetSizer(mainSizer); @@ -147,77 +147,77 @@ struct UpdateDlg::Data mainSizer->SetSizeHints(window); mainSizer->Fit(window); - m_buttonOk->SetDefault (); + m_buttonOk->SetDefault(); } void EnableControls() { - if (withRevision ()) + if (withRevision()) m_textRevision->Enable(!m_checkUseLatest->IsChecked()); } void - CheckButtons () + CheckButtons() { bool ok = true; - if (withRevision ()) + if (withRevision()) { - if (!m_checkUseLatest->IsChecked ()) + if (!m_checkUseLatest->IsChecked()) { - ok = CheckRevision (m_textRevision->GetValue ()); + ok = CheckRevision(m_textRevision->GetValue()); } } - if (ok && withUrl ()) + if (ok && withUrl()) { - svn::Path UrlUtf8 (PathUtf8 (m_comboUrl->GetValue ())); - ok = UrlUtf8.isUrl (); + svn::Path UrlUtf8(PathUtf8(m_comboUrl->GetValue())); + ok = UrlUtf8.isUrl(); } - m_buttonOk->Enable (ok); + m_buttonOk->Enable(ok); } bool - withRevision () + withRevision() { return (m_flags & WITHOUT_REVISION) == 0; } bool - withUrl () + withUrl() { return (m_flags & WITH_URL) != 0; } bool - withRecursive () + withRecursive() { return (m_flags & WITHOUT_RECURSIVE) == 0; } }; -BEGIN_EVENT_TABLE (UpdateDlg, wxDialog) - EVT_CHECKBOX (ID_USELATEST, UpdateDlg::OnUseLatest) - EVT_TEXT (ID_URL, UpdateDlg::OnText) - EVT_TEXT (ID_REVISION, UpdateDlg::OnText) -END_EVENT_TABLE () +BEGIN_EVENT_TABLE(UpdateDlg, wxDialog) + EVT_CHECKBOX(ID_USELATEST, UpdateDlg::OnUseLatest) + EVT_TEXT(ID_URL, UpdateDlg::OnText) + EVT_TEXT(ID_REVISION, UpdateDlg::OnText) +END_EVENT_TABLE() const int UpdateDlg::WITH_URL = 1; const int UpdateDlg::WITHOUT_RECURSIVE = 2; const int UpdateDlg::WITHOUT_REVISION = 4; -UpdateDlg::UpdateDlg (wxWindow* parent, const wxString & title, int flags, - bool recursive) - : wxDialog(parent, -1, title, - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +UpdateDlg::UpdateDlg(wxWindow* parent, const wxString & title, int flags, + bool recursive) + : wxDialog(parent, -1, title, + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - m = new Data (this, flags, recursive); + m = new Data(this, flags, recursive); CentreOnParent(); } -UpdateDlg::~UpdateDlg () +UpdateDlg::~UpdateDlg() { delete m; } @@ -227,26 +227,26 @@ UpdateDlg::InitDialog() { wxDialog::InitDialog(); m->EnableControls(); - m->CheckButtons (); + m->CheckButtons(); } void UpdateDlg::OnUseLatest(wxCommandEvent &) { m->EnableControls(); - m->CheckButtons (); + m->CheckButtons(); } UpdateData & -UpdateDlg::GetData () +UpdateDlg::GetData() { return m->data; } void -UpdateDlg::OnText (wxCommandEvent &) +UpdateDlg::OnText(wxCommandEvent &) { - m->CheckButtons (); + m->CheckButtons(); } /* ----------------------------------------------------------------- diff --git a/src/update_dlg.hpp b/src/update_dlg.hpp index cec49f61..3a1afd6e 100644 --- a/src/update_dlg.hpp +++ b/src/update_dlg.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -49,20 +49,20 @@ class UpdateDlg:public wxDialog * @param flags flags for the window (@a WITH_URL) * @param recursive default flag for the "recursive" check */ - UpdateDlg (wxWindow* parent, - const wxString & title, - int flags = 0, - bool recursive = true); + UpdateDlg(wxWindow* parent, + const wxString & title, + int flags = 0, + bool recursive = true); /** * destructor */ - virtual ~UpdateDlg (); + virtual ~UpdateDlg(); UpdateData & - GetData (); + GetData(); - void InitDialog (); + void InitDialog(); private: struct Data; Data * m; @@ -71,7 +71,7 @@ class UpdateDlg:public wxDialog OnUseLatest(wxCommandEvent &event); void - OnText (wxCommandEvent & event); + OnText(wxCommandEvent & event); DECLARE_EVENT_TABLE() }; diff --git a/src/userresolve_action.cpp b/src/userresolve_action.cpp index 2edbddc2..2b3ad1fd 100644 --- a/src/userresolve_action.cpp +++ b/src/userresolve_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -40,55 +40,55 @@ #include "preferences.hpp" #include "utils.hpp" -UserResolveAction::UserResolveAction (wxWindow * parent) - : Action (parent, _("Resolve")) +UserResolveAction::UserResolveAction(wxWindow * parent) + : Action(parent, _("Resolve")) { } bool -UserResolveAction::Prepare () +UserResolveAction::Prepare() { // No dialog for UserResolve. - return Action::Prepare (); + return Action::Prepare(); } bool -UserResolveAction::Perform () +UserResolveAction::Perform() { Preferences prefs; - if (prefs.mergeTool.Length () == 0) + if (prefs.mergeTool.Length() == 0) { - TraceError (_("No merge tool set in the preferences")); + TraceError(_("No merge tool set in the preferences")); return false; } - const std::vector v = GetTargets (); + const std::vector v = GetTargets(); std::vector::const_iterator it; - svn::Client client (GetContext ()); - for (it = v.begin (); it != v.end (); it++) + svn::Client client(GetContext()); + for (it = v.begin(); it != v.end(); it++) { const svn::Path & path = *it; - - wxString resultPath = Utf8ToLocal (path.native ().c_str ()); + + wxString resultPath = Utf8ToLocal(path.native().c_str()); wxString minePath = resultPath + wxT(".mine"); - if (wxFileExists (resultPath) && wxFileExists (minePath)) + if (wxFileExists(resultPath) && wxFileExists(minePath)) { wxString search = resultPath + wxT(".r*"); wxFileSystem fileSystem; - wxString r1 = fileSystem.FindFirst (search, wxFILE); - wxString r2 = fileSystem.FindNext (); + wxString r1 = fileSystem.FindFirst(search, wxFILE); + wxString r2 = fileSystem.FindNext(); - if (!r1.IsEmpty () && !r2.IsEmpty ()) + if (!r1.IsEmpty() && !r2.IsEmpty()) { long r1val; long r2val; - - if (r1.AfterLast ('r').ToLong (&r1val) && r2.AfterLast ('r').ToLong (&r2val)) + + if (r1.AfterLast('r').ToLong(&r1val) && r2.AfterLast('r').ToLong(&r2val)) { wxString basePath; wxString theirsPath; @@ -105,30 +105,30 @@ UserResolveAction::Perform () } // prepare command line to execute - wxString args (prefs.mergeToolArgs); + wxString args(prefs.mergeToolArgs); - TrimString (args); + TrimString(args); - if (args.Length () == 0) - args.Printf (wxT("\"%s\" \"%s\" \"%s\" \"%s\""), basePath.c_str (), - theirsPath.c_str (), - minePath.c_str (), - resultPath.c_str ()); + if (args.Length() == 0) + args.Printf(wxT("\"%s\" \"%s\" \"%s\" \"%s\""), basePath.c_str(), + theirsPath.c_str(), + minePath.c_str(), + resultPath.c_str()); else { - args.Replace (wxT("%1"), basePath.c_str (), true); - args.Replace (wxT("%2"), theirsPath.c_str (), true); - args.Replace (wxT("%3"), minePath.c_str (), true); - args.Replace (wxT("%4"), resultPath.c_str (), true); + args.Replace(wxT("%1"), basePath.c_str(), true); + args.Replace(wxT("%2"), theirsPath.c_str(), true); + args.Replace(wxT("%3"), minePath.c_str(), true); + args.Replace(wxT("%4"), resultPath.c_str(), true); } - wxString cmd (prefs.mergeTool + wxT(" ") + args); + wxString cmd(prefs.mergeTool + wxT(" ") + args); wxString msg; - msg.Printf (_("Execute merge tool: %s"), cmd.c_str ()); - Trace (msg); - - ActionEvent::Post (GetParent (), TOKEN_CMD_MERGE, cmd); + msg.Printf(_("Execute merge tool: %s"), cmd.c_str()); + Trace(msg); + + ActionEvent::Post(GetParent(), TOKEN_CMD_MERGE, cmd); } } } @@ -138,19 +138,19 @@ UserResolveAction::Perform () } bool -UserResolveAction::CheckStatusSel (const svn::StatusSel & statusSel) +UserResolveAction::CheckStatusSel(const svn::StatusSel & statusSel) { // well, we allow only a single+versioned+local file - if (!statusSel.hasVersioned ()) + if (!statusSel.hasVersioned()) return false; - if (statusSel.size () != 1) + if (statusSel.size() != 1) return false; - if (!statusSel.hasLocal ()) + if (!statusSel.hasLocal()) return false; - if (!statusSel.hasFiles ()) + if (!statusSel.hasFiles()) return false; return true; diff --git a/src/userresolve_action.hpp b/src/userresolve_action.hpp index 8221550e..f32756d5 100644 --- a/src/userresolve_action.hpp +++ b/src/userresolve_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -36,16 +36,16 @@ namespace svn class UserResolveAction:public Action { public: - UserResolveAction (wxWindow * parent); + UserResolveAction(wxWindow * parent); - virtual bool - Perform (); + virtual bool + Perform(); - virtual bool - Prepare (); + virtual bool + Prepare(); static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); }; #endif diff --git a/src/utils.cpp b/src/utils.cpp index 366d0ef4..32dd5147 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -74,43 +74,43 @@ static const bool UseBitmapMenus = true; static wxMenuItem * -CreateMenuItem ( +CreateMenuItem( wxMenu * parentMenu, int id, const wxString & text, const wxBitmap & bitmap) { - wxMenuItem * item = new wxMenuItem (parentMenu, id, text); - if(UseBitmapMenus) - item->SetBitmap (bitmap); + wxMenuItem * item = new wxMenuItem(parentMenu, id, text); + if (UseBitmapMenus) + item->SetBitmap(bitmap); return item; } static wxMenuItem * -CreateMenuItem ( +CreateMenuItem( wxMenu * parentMenu, int id, const wxString & text) { - return new wxMenuItem (parentMenu, id, text); + return new wxMenuItem(parentMenu, id, text); } static wxMenuItem * -AppendMenuItem ( +AppendMenuItem( wxMenu * parentMenu, int id, const wxString & text, const wxBitmap & bitmap) { - wxMenuItem * item = CreateMenuItem (parentMenu, id, text, bitmap); - parentMenu->Append (item); + wxMenuItem * item = CreateMenuItem(parentMenu, id, text, bitmap); + parentMenu->Append(item); return item; } static wxMenuItem * -AppendMenuItem ( +AppendMenuItem( wxMenu * parentMenu, int id, const wxString & text) { - wxMenuItem * item = CreateMenuItem (parentMenu, id, text); - parentMenu->Append (item); + wxMenuItem * item = CreateMenuItem(parentMenu, id, text); + parentMenu->Append(item); return item; } -wxString & UnixPath (wxString & path) +wxString & UnixPath(wxString & path) { #ifdef _WIN32 path.Replace(wxT("\\"), wxT("/")); @@ -120,20 +120,20 @@ wxString & UnixPath (wxString & path) void -TrimString (wxString & str) +TrimString(wxString & str) { - str.Trim (TRUE); - str.Trim (FALSE); + str.Trim(TRUE); + str.Trim(FALSE); } -bool PostMenuEvent (wxEvtHandler *source, long id) +bool PostMenuEvent(wxEvtHandler *source, long id) { // This is the way it's done in wxFrame - wxCommandEvent event (wxEVT_COMMAND_MENU_SELECTED, id); + wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, id); - event.SetEventObject (source); + event.SetEventObject(source); - return source->ProcessEvent (event); + return source->ProcessEvent(event); } wxButton * @@ -142,7 +142,7 @@ CreateEllipsisButton(wxWindow *parent, long id) const wxChar *ELLIPSIS = wxT("..."); int ellipsis_width, ellipsis_height; - wxButton *button = new wxButton (parent, id, ELLIPSIS); + wxButton *button = new wxButton(parent, id, ELLIPSIS); parent->GetTextExtent(ELLIPSIS, &ellipsis_width, &ellipsis_height); // HACK: Should get real button border size from somewhere @@ -152,88 +152,88 @@ CreateEllipsisButton(wxWindow *parent, long id) } void -AppendModifyMenu (wxMenu * parentMenu) +AppendModifyMenu(wxMenu * parentMenu) { - AppendMenuItem (*parentMenu, ID_Edit); + AppendMenuItem(*parentMenu, ID_Edit); - parentMenu->AppendSeparator (); - AppendMenuItem (*parentMenu, ID_Update); - AppendMenuItem (*parentMenu, ID_Commit); + parentMenu->AppendSeparator(); + AppendMenuItem(*parentMenu, ID_Update); + AppendMenuItem(*parentMenu, ID_Commit); - parentMenu->AppendSeparator (); + parentMenu->AppendSeparator(); - AppendMenuItem (parentMenu, ID_Property, _("&Properties...\tCTRL-P"), - EMBEDDED_BITMAP(info_png)); + AppendMenuItem(parentMenu, ID_Property, _("&Properties...\tCTRL-P"), + EMBEDDED_BITMAP(info_png)); - parentMenu->AppendSeparator (); + parentMenu->AppendSeparator(); - AppendMenuItem (parentMenu, ID_Add, _("&Add\tINS"), - EMBEDDED_BITMAP(add_png)); - AppendMenuItem (parentMenu, ID_AddRecursive, _("Add r&ecursive")); - AppendMenuItem (parentMenu, ID_Delete, _("&Delete\tDEL"), - EMBEDDED_BITMAP(delete_png)); - AppendMenuItem (parentMenu, ID_Ignore, _("&Ignore\tCTRL-DEL")); + AppendMenuItem(parentMenu, ID_Add, _("&Add\tINS"), + EMBEDDED_BITMAP(add_png)); + AppendMenuItem(parentMenu, ID_AddRecursive, _("Add r&ecursive")); + AppendMenuItem(parentMenu, ID_Delete, _("&Delete\tDEL"), + EMBEDDED_BITMAP(delete_png)); + AppendMenuItem(parentMenu, ID_Ignore, _("&Ignore\tCTRL-DEL")); - parentMenu->AppendSeparator (); + parentMenu->AppendSeparator(); - AppendMenuItem (parentMenu, ID_Revert, _("Re&vert\tCTRL-V"), - EMBEDDED_BITMAP(revert_png)); - AppendMenuItem (parentMenu, ID_UserResolve, _("In&teractive Resolve...\tCTRL-T")); - AppendMenuItem (parentMenu, ID_Resolve, _("Re&solve conflicts\tCTRL-S"), - EMBEDDED_BITMAP(resolve_png)); + AppendMenuItem(parentMenu, ID_Revert, _("Re&vert\tCTRL-V"), + EMBEDDED_BITMAP(revert_png)); + AppendMenuItem(parentMenu, ID_UserResolve, _("In&teractive Resolve...\tCTRL-T")); + AppendMenuItem(parentMenu, ID_Resolve, _("Re&solve conflicts\tCTRL-S"), + EMBEDDED_BITMAP(resolve_png)); - parentMenu->AppendSeparator (); + parentMenu->AppendSeparator(); - AppendMenuItem (parentMenu, ID_Copy, _("&Copy...\tF5"), - EMBEDDED_BITMAP(copy_png)); - AppendMenuItem (parentMenu, ID_Move, _("M&ove...\tF6"), - EMBEDDED_BITMAP(move_png)); - AppendMenuItem (parentMenu, ID_Rename, _("Re&name...\tCTRL-N"), - EMBEDDED_BITMAP(rename_png)); - AppendMenuItem (parentMenu, ID_Mkdir, _("Make &directory...\tF7")); + AppendMenuItem(parentMenu, ID_Copy, _("&Copy...\tF5"), + EMBEDDED_BITMAP(copy_png)); + AppendMenuItem(parentMenu, ID_Move, _("M&ove...\tF6"), + EMBEDDED_BITMAP(move_png)); + AppendMenuItem(parentMenu, ID_Rename, _("Re&name...\tCTRL-N"), + EMBEDDED_BITMAP(rename_png)); + AppendMenuItem(parentMenu, ID_Mkdir, _("Make &directory...\tF7")); - parentMenu->AppendSeparator (); + parentMenu->AppendSeparator(); - AppendMenuItem (parentMenu, ID_Lock, _("&Lock...")); - AppendMenuItem (parentMenu, ID_Unlock, _("&Unlock")); + AppendMenuItem(parentMenu, ID_Lock, _("&Lock...")); + AppendMenuItem(parentMenu, ID_Unlock, _("&Unlock")); } void -AppendQueryMenu (wxMenu * parentMenu) +AppendQueryMenu(wxMenu * parentMenu) { - AppendMenuItem (parentMenu, ID_Diff, _("&Diff...\tCTRL+D")); - AppendMenuItem (parentMenu, ID_DiffBase, _("&Diff to Base...\tCTRL+B")); - AppendMenuItem (parentMenu, ID_DiffHead, _("&Diff to Head...\tCTRL+H")); - parentMenu->AppendSeparator (); - AppendMenuItem (parentMenu, ID_Log, _("&Log...\tCTRL-L"), - EMBEDDED_BITMAP(log_png)); - AppendMenuItem (parentMenu, ID_Info, _("&Info..."), - EMBEDDED_BITMAP(info_png)); - AppendMenuItem (parentMenu, ID_Annotate, _("&Annotate..."), - EMBEDDED_BITMAP(annotate_png)); + AppendMenuItem(parentMenu, ID_Diff, _("&Diff...\tCTRL+D")); + AppendMenuItem(parentMenu, ID_DiffBase, _("&Diff to Base...\tCTRL+B")); + AppendMenuItem(parentMenu, ID_DiffHead, _("&Diff to Head...\tCTRL+H")); + parentMenu->AppendSeparator(); + AppendMenuItem(parentMenu, ID_Log, _("&Log...\tCTRL-L"), + EMBEDDED_BITMAP(log_png)); + AppendMenuItem(parentMenu, ID_Info, _("&Info..."), + EMBEDDED_BITMAP(info_png)); + AppendMenuItem(parentMenu, ID_Annotate, _("&Annotate..."), + EMBEDDED_BITMAP(annotate_png)); } void -AppendBookmarksMenu (wxMenu * parentMenu) +AppendBookmarksMenu(wxMenu * parentMenu) { - AppendMenuItem (*parentMenu, ID_AddWcBookmark); - AppendMenuItem (*parentMenu, ID_AddRepoBookmark); - AppendMenuItem (*parentMenu, ID_Switch); - parentMenu->AppendSeparator (); - AppendMenuItem (*parentMenu, ID_EditBookmark); - AppendMenuItem (*parentMenu, ID_RemoveBookmark); + AppendMenuItem(*parentMenu, ID_AddWcBookmark); + AppendMenuItem(*parentMenu, ID_AddRepoBookmark); + AppendMenuItem(*parentMenu, ID_Switch); + parentMenu->AppendSeparator(); + AppendMenuItem(*parentMenu, ID_EditBookmark); + AppendMenuItem(*parentMenu, ID_RemoveBookmark); } bool -CheckRevision (const wxString & revstring) +CheckRevision(const wxString & revstring) { svn_revnum_t revnum; - return ParseRevision (revstring, revnum); + return ParseRevision(revstring, revnum); } wxMenuItem * -AppendMenuItem (wxMenu & menu, int id) +AppendMenuItem(wxMenu & menu, int id) { wxString caption; wxBitmap bitmap; @@ -318,27 +318,27 @@ AppendMenuItem (wxMenu & menu, int id) caption = _("Explore...\tF2"); } - wxMenuItem * item = AppendMenuItem (&menu, id, caption, bitmap); - + wxMenuItem * item = AppendMenuItem(&menu, id, caption, bitmap); + return item; } bool -ParseRevision (const wxString & revstring, svn_revnum_t & revnum) +ParseRevision(const wxString & revstring, svn_revnum_t & revnum) { - wxString value (revstring); + wxString value(revstring); - TrimString (value); - if (value.Length () <= 0) + TrimString(value); + if (value.Length() <= 0) return false; - return value.ToLong (&revnum); + return value.ToLong(&revnum); } wxString -FormatDateTime (apr_time_t date, wxString fmt) +FormatDateTime(apr_time_t date, wxString fmt) { wxString wxstrtime; if (date == 0) @@ -350,12 +350,12 @@ FormatDateTime (apr_time_t date, wxString fmt) if (!apr_err) { wxDateTime wxdate = wxDateTime( - (wxDateTime::wxDateTime_t)te.tm_mday, - (wxDateTime::Month)te.tm_mon, - (int)te.tm_year + 1900, - (wxDateTime::wxDateTime_t)te.tm_hour, - (wxDateTime::wxDateTime_t)te.tm_min, - (wxDateTime::wxDateTime_t)te.tm_sec); + (wxDateTime::wxDateTime_t)te.tm_mday, + (wxDateTime::Month)te.tm_mon, + (int)te.tm_year + 1900, + (wxDateTime::wxDateTime_t)te.tm_hour, + (wxDateTime::wxDateTime_t)te.tm_min, + (wxDateTime::wxDateTime_t)te.tm_sec); wxstrtime = wxdate.Format(fmt); } return wxstrtime; @@ -363,24 +363,24 @@ FormatDateTime (apr_time_t date, wxString fmt) wxString -BeautifyPath (const wxString & path) +BeautifyPath(const wxString & path) { - int pos = path.Find (wxT(":")); + int pos = path.Find(wxT(":")); if (pos <= 0) return path; // ok. we do have a dot. So is it an url or // a windows drive? - wxString start (path.Left (pos)); + wxString start(path.Left(pos)); // lowercase the Drive / URL schema part - return start.Lower () + path.Mid (pos); + return start.Lower() + path.Mid(pos); } wxString -StatusDescription (const svn_wc_status_kind kind) +StatusDescription(const svn_wc_status_kind kind) { switch (kind) { @@ -389,7 +389,7 @@ StatusDescription (const svn_wc_status_kind kind) break; case svn_wc_status_unversioned: return _("unversioned"); - break; + break; case svn_wc_status_normal: return _("normal"); break; @@ -433,7 +433,7 @@ StatusDescription (const svn_wc_status_kind kind) #if !wxUSE_UNICODE static wxMBConv * -GetWXLocalConv () +GetWXLocalConv() { #if defined(__WXGTK20__) // In wxGTK 2.0+, for some reason wvConvCurrent @@ -444,7 +444,7 @@ GetWXLocalConv () if (wxConvCorrect == NULL) { - if (wxOKlibc ()) + if (wxOKlibc()) { wxConvCorrect = &wxConvLibc; } @@ -463,130 +463,130 @@ GetWXLocalConv () #endif wxString -Utf8ToLocal (const char* srcUtf8) +Utf8ToLocal(const char* srcUtf8) { #if wxUSE_UNICODE - wxString dst (srcUtf8, wxConvUTF8); + wxString dst(srcUtf8, wxConvUTF8); #else - wxString dst (wxConvUTF8.cMB2WC(srcUtf8), *GetWXLocalConv ()); + wxString dst(wxConvUTF8.cMB2WC(srcUtf8), *GetWXLocalConv()); #endif return dst; } wxString -Utf8ToLocal (const std::string& srcUtf8) +Utf8ToLocal(const std::string& srcUtf8) { return Utf8ToLocal(srcUtf8.c_str()); } std::string -LocalToUtf8 (const wxString & srcLocal) +LocalToUtf8(const wxString & srcLocal) { #if wxUSE_UNICODE - std::string dst (srcLocal.mb_str (wxConvUTF8)); + std::string dst(srcLocal.mb_str(wxConvUTF8)); #else - wxString wxdst (srcLocal.wc_str (*GetWXLocalConv ()), wxConvUTF8); - std::string dst (wxdst.mb_str ()); + wxString wxdst(srcLocal.wc_str(*GetWXLocalConv()), wxConvUTF8); + std::string dst(wxdst.mb_str()); #endif return dst; } void -LocalToUtf8 (const wxString & srcLocal, std::string & dstUtf8) +LocalToUtf8(const wxString & srcLocal, std::string & dstUtf8) { #if wxUSE_UNICODE - dstUtf8 = srcLocal.mb_str (wxConvUTF8); + dstUtf8 = srcLocal.mb_str(wxConvUTF8); #else - wxString wxdst (srcLocal.wc_str (*GetWXLocalConv ()), wxConvUTF8); - dstUtf8 = wxdst.mb_str (); + wxString wxdst(srcLocal.wc_str(*GetWXLocalConv()), wxConvUTF8); + dstUtf8 = wxdst.mb_str(); #endif } svn::Path -PathUtf8 (const wxString & path) +PathUtf8(const wxString & path) { #if wxUSE_UNICODE - return path.mb_str (wxConvUTF8).data (); + return path.mb_str(wxConvUTF8).data(); #else - wxString wxdst (path.wc_str (*GetWXLocalConv ()), wxConvUTF8); - return wxdst.mb_str (); + wxString wxdst(path.wc_str(*GetWXLocalConv()), wxConvUTF8); + return wxdst.mb_str(); #endif } void -AppendVerbMenu (wxMenu * parentMenu, svn::Status * status) +AppendVerbMenu(wxMenu * parentMenu, svn::Status * status) { - wxASSERT (status); + wxASSERT(status); - // Append file verbs - try - { - VerbList verbList; - - // We don't want verbs on directories, even though they exist - bool isADirectory = status->entry ().kind () == svn_node_dir; - if (!isADirectory) - verbList.InitFromDocument (Utf8ToLocal (status->path ()), isADirectory ); + // Append file verbs + try + { + VerbList verbList; - if (verbList.GetCount () == 0) - return; + // We don't want verbs on directories, even though they exist + bool isADirectory = status->entry().kind() == svn_node_dir; + if (!isADirectory) + verbList.InitFromDocument(Utf8ToLocal(status->path()), isADirectory); - wxMenu * menu = new wxMenu (); + if (verbList.GetCount() == 0) + return; - size_t i = 0; - for (; - (i < verbList.GetCount ()) && - (i < (ID_Verb_Max - ID_Verb_Min + 1)); i++) - { - wxMenuItem *pItem; - pItem = new wxMenuItem (menu, ID_Verb_Min + i, verbList.GetName (i)); - menu->Append (pItem); - } + wxMenu * menu = new wxMenu(); - parentMenu->Append (ID_Open, _("Open..."), menu); - } - catch (...) + size_t i = 0; + for (; + (i < verbList.GetCount()) && + (i < (ID_Verb_Max - ID_Verb_Min + 1)); i++) { - // Failed assembling verbs. - // TODO: Report this error in the status bar? + wxMenuItem *pItem; + pItem = new wxMenuItem(menu, ID_Verb_Min + i, verbList.GetName(i)); + menu->Append(pItem); } + + parentMenu->Append(ID_Open, _("Open..."), menu); + } + catch (...) + { + // Failed assembling verbs. + // TODO: Report this error in the status bar? + } } -wxBitmap -EmbeddedBitmap (const unsigned char * data, size_t len) +wxBitmap +EmbeddedBitmap(const unsigned char * data, size_t len) { - wxMemoryInputStream is (data, len); - wxImage img (is, wxBITMAP_TYPE_ANY, -1); - img.ConvertAlphaToMask (); - return wxBitmap (img, -1); + wxMemoryInputStream is(data, len); + wxImage img(is, wxBITMAP_TYPE_ANY, -1); + img.ConvertAlphaToMask(); + return wxBitmap(img, -1); } void -OpenURL (const wxString & url) +OpenURL(const wxString & url) { #ifdef _WIN32 // Right now @ref wxLaunchDefaultBrowser works only on // Windows, we have to work on this and detect // the browser on Mac OS and Linux as well - wxLaunchDefaultBrowser (url); + wxLaunchDefaultBrowser(url); #else // Well, maybe we can run Firefox? wxString args; - args.Printf (wxT("firefox \"%s\""), url.c_str ()); - wxExecute (args, wxEXEC_ASYNC | wxEXEC_NOHIDE); + args.Printf(wxT("firefox \"%s\""), url.c_str()); + wxExecute(args, wxEXEC_ASYNC | wxEXEC_NOHIDE); #endif } wxString -PathToNative (const svn::Path & path) +PathToNative(const svn::Path & path) { - return Utf8ToLocal (path.native ()); + return Utf8ToLocal(path.native()); } wxString @@ -594,20 +594,20 @@ FullNativePath(const svn::Path & target, const wxString & base, bool flat) { if (target.isUrl()) { - return PathToNative (target); + return PathToNative(target); } else { if (flat) { - wxFileName filename = wxFileName::FileName (PathToNative (target)); - filename.Normalize (); + wxFileName filename = wxFileName::FileName(PathToNative(target)); + filename.Normalize(); return filename.GetFullPath(); } else { - return base + wxFileName::GetPathSeparator () + - wxFileName::FileName (PathToNative (target)).GetFullName (); + return base + wxFileName::GetPathSeparator() + + wxFileName::FileName(PathToNative(target)).GetFullName(); } } } diff --git a/src/utils.hpp b/src/utils.hpp index a7057481..d6a6f774 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -50,9 +50,9 @@ namespace svn * declaration of an array with @a svn_revnum_t elements */ #ifdef WX_DEFINE_ARRAY_LONG -WX_DEFINE_ARRAY_LONG (svn_revnum_t, RevnumArray); +WX_DEFINE_ARRAY_LONG(svn_revnum_t, RevnumArray); #else -WX_DEFINE_ARRAY (svn_revnum_t, RevnumArray); +WX_DEFINE_ARRAY(svn_revnum_t, RevnumArray); #endif @@ -65,38 +65,38 @@ WX_DEFINE_ARRAY (svn_revnum_t, RevnumArray); * @param path Native path to convert * @return string with all backslashes converted to forward slashes */ -wxString & -UnixPath (wxString & path); +wxString & +UnixPath(wxString & path); /** * Trim whitespace at start and end of string * (Convenience function for trimming first left, then right) */ -void -TrimString (wxString & str); +void +TrimString(wxString & str); /** - * Post a menu command event with the given ID. + * Post a menu command event with the given ID. * * Used for converting non-command events to command events so they'll move up * the GUI hierarchy. */ -bool -PostMenuEvent (wxEvtHandler *source, long id); +bool +PostMenuEvent(wxEvtHandler *source, long id); /** * Create a correctly sized button with an ellipsis (three dots) */ wxButton * -CreateEllipsisButton (wxWindow *parent, long id); +CreateEllipsisButton(wxWindow *parent, long id); /** * Append entries for the "Modify" menu * * @param parentMenu menu that will receive the items */ -void -AppendModifyMenu (wxMenu * parentMenu); +void +AppendModifyMenu(wxMenu * parentMenu); /** * Append entries for the "Repository" menu @@ -104,15 +104,15 @@ AppendModifyMenu (wxMenu * parentMenu); * @param parentMenu menu that will receive the items */ void -AppendBookmarksMenu (wxMenu * parentMenu); +AppendBookmarksMenu(wxMenu * parentMenu); /** * Append entries for the "Query" menu * * @param parentMenu menu that will receive the items */ -void -AppendQueryMenu (wxMenu * parentMenu); +void +AppendQueryMenu(wxMenu * parentMenu); /** @@ -125,7 +125,7 @@ AppendQueryMenu (wxMenu * parentMenu); * @param status status instance of the selected item */ void -AppendVerbMenu (wxMenu * parentMenu, svn::Status * status); +AppendVerbMenu(wxMenu * parentMenu, svn::Status * status); /** @@ -136,7 +136,7 @@ AppendVerbMenu (wxMenu * parentMenu, svn::Status * status); * @return true if valid revision */ bool -CheckRevision (const wxString & revstring); +CheckRevision(const wxString & revstring); /** @@ -147,7 +147,7 @@ CheckRevision (const wxString & revstring); * @param id menu item to create */ wxMenuItem * -AppendMenuItem (wxMenu & menu, int id); +AppendMenuItem(wxMenu & menu, int id); /** @@ -159,18 +159,18 @@ AppendMenuItem (wxMenu & menu, int id); * @retval true valid revision number */ bool -ParseRevision (const wxString & revstring, svn_revnum_t & revnum); +ParseRevision(const wxString & revstring, svn_revnum_t & revnum); /** * Format a date/time value to standard format * - * @param data + * @param data * @param fmt format string * @return formatted date/time string */ wxString -FormatDateTime (apr_time_t date, wxString fmt = wxT("%x %X")); +FormatDateTime(apr_time_t date, wxString fmt = wxT("%x %X")); /** @@ -184,7 +184,7 @@ FormatDateTime (apr_time_t date, wxString fmt = wxT("%x %X")); * 2. Local Windows path (uppercase drive letter) * Before: d:\Documents and Settings\alex\Application Data * After: D:\Documents and Settings\alex\Application Data - * + * * 3. Repository URL (lowercase url schema) * Before: https://svn.collab.net/repos/rapidsvn/trunk/src/svncpp * After: https://svn.collab.net/repos/rapidsvn/trunk/src/svncpp @@ -196,22 +196,22 @@ FormatDateTime (apr_time_t date, wxString fmt = wxT("%x %X")); * @param path input path * @return beatified path */ -wxString -BeautifyPath (const wxString & path); +wxString +BeautifyPath(const wxString & path); /** - * creates a textual description for a status value + * creates a textual description for a status value * * @param kind * @return brief textual description */ wxString -StatusDescription (const svn_wc_status_kind kind); +StatusDescription(const svn_wc_status_kind kind); /** - * converts a string from local encoding (like Ansi on + * converts a string from local encoding (like Ansi on * Windows) to utf8 * * @see Utf8ToLocal @@ -220,10 +220,10 @@ StatusDescription (const svn_wc_status_kind kind); * @return string in utf8 encoding */ std::string -LocalToUtf8 (const wxString & srcLocal); +LocalToUtf8(const wxString & srcLocal); /** - * converts a string from local encoding (like Ansi on + * converts a string from local encoding (like Ansi on * Windows) to utf8 * * @see Utf8ToLocal @@ -232,7 +232,7 @@ LocalToUtf8 (const wxString & srcLocal); * @param dstUtf8 string in utf8 encoding */ void -LocalToUtf8 (const wxString & srcLocal, std::string & dstUtf8); +LocalToUtf8(const wxString & srcLocal, std::string & dstUtf8); /** * converts a string from local encoding to a utf8 path @@ -241,21 +241,21 @@ LocalToUtf8 (const wxString & srcLocal, std::string & dstUtf8); * @return path in utf8 */ svn::Path -PathUtf8 (const wxString & path); +PathUtf8(const wxString & path); /** * converts an utf8 path to a string in local encoding * with native path separators - * + * * @param path source * @param path string in local encoding */ wxString -PathToNative (const svn::Path & path); +PathToNative(const svn::Path & path); /** - * converts a string from utf to the local encoding + * converts a string from utf to the local encoding * (like Ansi on Windows) * * @see LocalToUtf8 @@ -264,10 +264,10 @@ PathToNative (const svn::Path & path); * @return string in local encoding */ wxString -Utf8ToLocal (const char* srcUtf8); +Utf8ToLocal(const char* srcUtf8); /** - * converts a string from utf to the local encoding + * converts a string from utf to the local encoding * (like Ansi on Windows) * * @see LocalToUtf8 @@ -276,12 +276,12 @@ Utf8ToLocal (const char* srcUtf8); * @return string in local encoding */ wxString -Utf8ToLocal (const std::string & srcUtf8); +Utf8ToLocal(const std::string & srcUtf8); /** * Convert a character array to a wxBitmap. * You have to ensure the contents of the array string - * contains a valid image + * contains a valid image * * @remark The suggestion to this code is from * http://www.wxwidgets.org/index.php/Embedding_PNG_Images @@ -292,11 +292,11 @@ Utf8ToLocal (const std::string & srcUtf8); * @para len number of elements in the array * @return the bitmap */ -wxBitmap -EmbeddedBitmap (const unsigned char * data, size_t len); +wxBitmap +EmbeddedBitmap(const unsigned char * data, size_t len); /** - * Macro that saves you from having to + * Macro that saves you from having to * add the @a len parameter to @ref EmbeddedBitmap */ #define EMBEDDED_BITMAP(data) EmbeddedBitmap (data, sizeof (data)) @@ -308,7 +308,7 @@ EmbeddedBitmap (const unsigned char * data, size_t len); * @param url URL to open */ void -OpenURL (const wxString & url); +OpenURL(const wxString & url); /** * Converts svn::Path to native full path expression @@ -320,7 +320,7 @@ OpenURL (const wxString & url); * WS / No : Input path may be relative (if reflesh with update * checed), but all files must be in FolderBrowser * selected path. - * WS / Yes : FolderBrowser selection is not reliable because + * WS / Yes : FolderBrowser selection is not reliable because * various pathes are shown in file list. But input * path is always full path in this mode. * diff --git a/src/verblist.cpp b/src/verblist.cpp index 84c3ab09..56db9840 100644 --- a/src/verblist.cpp +++ b/src/verblist.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -46,12 +46,12 @@ * NON WINDOWS IMPLEMENTATION OF VerbList *********************************************************************/ -VerbList::VerbList () +VerbList::VerbList() { } -VerbList::~VerbList () +VerbList::~VerbList() { } @@ -62,22 +62,22 @@ VerbList::InitFromDocument(const wxString & documentPath, bool isAFolder) size_t -VerbList::GetCount () const +VerbList::GetCount() const { return 0; } const wxString & -VerbList::GetName (size_t index) const +VerbList::GetName(size_t index) const { - static const wxString empty (wxT("")); + static const wxString empty(wxT("")); return empty; } void -VerbList::Launch (size_t index) const +VerbList::Launch(size_t index) const { } @@ -102,9 +102,9 @@ struct Verb wxString m_dde_app; wxString m_dde_topic; - Verb (); + Verb(); - virtual ~ Verb () {}; + virtual ~ Verb() {}; /** * Read verb information from the given verb of the given key in the @@ -139,64 +139,64 @@ struct VerbList::Data //********************************************************************* -Verb::Verb () : m_uses_dde (false) +Verb::Verb() : m_uses_dde(false) { } bool -Verb::ReadFromRegistry (const wxRegKey & base, const wxString & verb_name) +Verb::ReadFromRegistry(const wxRegKey & base, const wxString & verb_name) { - // Store descriptive verb name + // Store descriptive verb name m_name = verb_name; - wxString command_key_name (verb_name + wxT("\\command")); + wxString command_key_name(verb_name + wxT("\\command")); // Read command key - if (!base.HasSubKey (command_key_name)) + if (!base.HasSubKey(command_key_name)) return false; - wxRegKey command_key (base, command_key_name); + wxRegKey command_key(base, command_key_name); - command_key.QueryValue (NULL, m_command); + command_key.QueryValue(NULL, m_command); // Attempt to read ddeexec key m_dde_command = wxT(""); m_dde_topic = wxT(""); m_dde_app = wxT(""); - const wxString dde_command_key_name (verb_name + wxT("\\ddeexec")); - m_uses_dde = base.HasSubKey (dde_command_key_name); + const wxString dde_command_key_name(verb_name + wxT("\\ddeexec")); + m_uses_dde = base.HasSubKey(dde_command_key_name); if (m_uses_dde) { - wxRegKey dde_command_key (base, dde_command_key_name);; - if (dde_command_key.HasValue (NULL)) - dde_command_key.QueryValue (NULL, m_dde_command); + wxRegKey dde_command_key(base, dde_command_key_name);; + if (dde_command_key.HasValue(NULL)) + dde_command_key.QueryValue(NULL, m_dde_command); - const wxString dde_topic_name (wxT("Topic")); - if (dde_command_key.HasSubKey (dde_topic_name)) + const wxString dde_topic_name(wxT("Topic")); + if (dde_command_key.HasSubKey(dde_topic_name)) { - wxRegKey dde_topic_key (dde_command_key, dde_topic_name); - if (dde_topic_key.HasValue (NULL)) - dde_topic_key.QueryValue (NULL, m_dde_topic); + wxRegKey dde_topic_key(dde_command_key, dde_topic_name); + if (dde_topic_key.HasValue(NULL)) + dde_topic_key.QueryValue(NULL, m_dde_topic); } - const wxString dde_application_name (wxT("Application")); - if (dde_command_key.HasSubKey (dde_application_name)) + const wxString dde_application_name(wxT("Application")); + if (dde_command_key.HasSubKey(dde_application_name)) { - wxRegKey dde_app_key (dde_command_key, dde_application_name); - if (dde_app_key.HasValue (NULL)) - dde_app_key.QueryValue (NULL, m_dde_app); + wxRegKey dde_app_key(dde_command_key, dde_application_name); + if (dde_app_key.HasValue(NULL)) + dde_app_key.QueryValue(NULL, m_dde_app); } } return true; } -void -Verb::Launch (const wxString & document_path) const +void +Verb::Launch(const wxString & document_path) const { - ShellExecute (NULL, m_name.c_str (), - document_path.c_str (), NULL, NULL, SW_SHOWNORMAL); + ShellExecute(NULL, m_name.c_str(), + document_path.c_str(), NULL, NULL, SW_SHOWNORMAL); // TODO: error handling } @@ -212,8 +212,8 @@ VerbList::~VerbList() delete m; } -void -VerbList::InitFromDocument (const wxString & document_path, bool isAFolder) +void +VerbList::InitFromDocument(const wxString & document_path, bool isAFolder) { // Algorithm: @@ -229,7 +229,7 @@ VerbList::InitFromDocument (const wxString & document_path, bool isAFolder) m->document_path = document_path; // Make sure list is empty - m->verb_list.clear (); + m->verb_list.clear(); wxString progid_key_name; @@ -242,81 +242,81 @@ VerbList::InitFromDocument (const wxString & document_path, bool isAFolder) else { // Find document extension - if (!m->document_path.HasExt ()) + if (!m->document_path.HasExt()) // Nothing to go on; we cannot provide an editor return; - wxString extension_key_name (wxT(".") + m->document_path.GetExt ()); - if (!regKeyHKCR.HasSubKey (extension_key_name)) + wxString extension_key_name(wxT(".") + m->document_path.GetExt()); + if (!regKeyHKCR.HasSubKey(extension_key_name)) return; - wxRegKey ext_key (regKeyHKCR, extension_key_name); - if (!ext_key.HasValue (NULL)) - return; + wxRegKey ext_key(regKeyHKCR, extension_key_name); + if (!ext_key.HasValue(NULL)) + return; - ext_key.QueryValue (NULL, progid_key_name); + ext_key.QueryValue(NULL, progid_key_name); } // Get information on progid (name, verbs) - if (!regKeyHKCR.HasSubKey (progid_key_name)) + if (!regKeyHKCR.HasSubKey(progid_key_name)) return; - wxRegKey progid_key (regKeyHKCR, progid_key_name); + wxRegKey progid_key(regKeyHKCR, progid_key_name); // Get long name of progid (ignored if not found) - if (progid_key.HasValue (NULL)) - progid_key.QueryValue (NULL, m->document_type_name); + if (progid_key.HasValue(NULL)) + progid_key.QueryValue(NULL, m->document_type_name); // Get verbs of progid - const wxString progid_shell (wxT("shell")); - if (!progid_key.HasSubKey (progid_shell)) + const wxString progid_shell(wxT("shell")); + if (!progid_key.HasSubKey(progid_shell)) return; - wxRegKey verb_base_key (progid_key, progid_shell); + wxRegKey verb_base_key(progid_key, progid_shell); // Get name of default verb (ignored if not found) - wxString default_verb_name (wxT("")); - if (verb_base_key.HasValue (NULL)) - verb_base_key.QueryValue (NULL, default_verb_name); + wxString default_verb_name(wxT("")); + if (verb_base_key.HasValue(NULL)) + verb_base_key.QueryValue(NULL, default_verb_name); wxString verb_key_name; long index; - bool ok = verb_base_key.GetFirstKey (verb_key_name, index); + bool ok = verb_base_key.GetFirstKey(verb_key_name, index); while (ok) { Verb verb; - if (verb.ReadFromRegistry (verb_base_key, verb_key_name)) + if (verb.ReadFromRegistry(verb_base_key, verb_key_name)) { // Place first if default if (verb_key_name == default_verb_name) - m->verb_list.insert (m->verb_list.begin (), verb); + m->verb_list.insert(m->verb_list.begin(), verb); else - m->verb_list.push_back (verb); + m->verb_list.push_back(verb); } // select next key - ok = verb_base_key.GetNextKey (verb_key_name, index); + ok = verb_base_key.GetNextKey(verb_key_name, index); } } -size_t -VerbList::GetCount () const +size_t +VerbList::GetCount() const { - return m->verb_list.size (); + return m->verb_list.size(); } const wxString & -VerbList::GetName (size_t index) const +VerbList::GetName(size_t index) const { return m->verb_list[index].m_name; } -void -VerbList::Launch (size_t index) const +void +VerbList::Launch(size_t index) const { - m->verb_list[index].Launch (m->document_path.GetFullPath ()); + m->verb_list[index].Launch(m->document_path.GetFullPath()); } diff --git a/src/verblist.hpp b/src/verblist.hpp index d240d817..9b50a3ca 100644 --- a/src/verblist.hpp +++ b/src/verblist.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -35,10 +35,10 @@ class VerbList { public: /** constructor */ - VerbList (); + VerbList(); /** destructor */ - virtual ~VerbList (); + virtual ~VerbList(); /** * Assemble list of verbs based on the given document which can be a folder @@ -46,34 +46,34 @@ class VerbList * * @throw std::exception on unexpected errors */ - void - InitFromDocument (const wxString & documentPath, bool isAFolder); + void + InitFromDocument(const wxString & documentPath, bool isAFolder); /** * @return Number of verbs in list */ - size_t - GetCount () const; + size_t + GetCount() const; /** * @return Name of verb with the given index */ - const wxString & - GetName (size_t index) const; + const wxString & + GetName(size_t index) const; /** * Launches the verb with the given index on the document on which the verb * list is based */ - void - Launch (size_t index) const; + void + Launch(size_t index) const; private: struct Data; Data *m; }; -#endif +#endif /* ----------------------------------------------------------------- * local variables: * eval: (load-file "../rapidsvn-dev.el") diff --git a/src/version.hpp b/src/version.hpp index 054af190..3c6c3c8e 100644 --- a/src/version.hpp +++ b/src/version.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -42,13 +42,13 @@ */ #define RAPIDSVN_VER_MAJOR 0 -/** +/** * Minor version number. */ #define RAPIDSVN_VER_MINOR 9 -/** - * Micro version number. +/** + * Micro version number. */ #define RAPIDSVN_VER_MICRO 7 diff --git a/src/view_action.cpp b/src/view_action.cpp index c91f1250..a602f961 100644 --- a/src/view_action.cpp +++ b/src/view_action.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -39,7 +39,7 @@ #include "utils.hpp" #include "view_action.hpp" -struct ViewAction::Data +struct ViewAction::Data { private: Action * action; @@ -49,90 +49,90 @@ struct ViewAction::Data GetData data; wxWindow * parent; - Data (Action * action_) - : action (action_) + Data(Action * action_) + : action(action_) { } - Data (Action * action_, GetData & data_) - : action (action_), data (data_) + Data(Action * action_, GetData & data_) + : action(action_), data(data_) { } }; -ViewAction::ViewAction (wxWindow * parent, - const GetData & data) - : Action (parent, _("View"), DONT_UPDATE) +ViewAction::ViewAction(wxWindow * parent, + const GetData & data) + : Action(parent, _("View"), DONT_UPDATE) { - m = new Data (this); + m = new Data(this); m->parent = parent; m->data = data; m->edit = false; } -ViewAction::ViewAction (wxWindow * parent) - : Action (parent, _("Edit"), UPDATE_LATER) +ViewAction::ViewAction(wxWindow * parent) + : Action(parent, _("Edit"), UPDATE_LATER) { - m = new Data (this); + m = new Data(this); m->parent = parent; m->edit = true; } bool -ViewAction::Prepare () +ViewAction::Prepare() { return true; } bool -ViewAction::Perform () +ViewAction::Perform() { Preferences prefs; - if (prefs.editor.Length () == 0) - throw RapidSvnEx ( + if (prefs.editor.Length() == 0) + throw RapidSvnEx( _("The Editor is not configured. Please check Edit->Preferences>Programs")); wxString path; if (m->edit) - path = Utf8ToLocal (GetTarget ().c_str ()); + path = Utf8ToLocal(GetTarget().c_str()); else { - svn::Path pathUtf8 (PathUtf8 (m->data.path)); - path = Utf8ToLocal ( - GetPathAsTempFile(pathUtf8.c_str (), - m->data.revision).c_str ()); + svn::Path pathUtf8(PathUtf8(m->data.path)); + path = Utf8ToLocal( + GetPathAsTempFile(pathUtf8.c_str(), + m->data.revision).c_str()); } - wxString args (prefs.editorArgs); - TrimString (args); + wxString args(prefs.editorArgs); + TrimString(args); - if (args.Length () == 0) + if (args.Length() == 0) args = wxT("\"") + path + wxT("\""); else - args.Replace (wxT("%1"), path, true); + args.Replace(wxT("%1"), path, true); - wxString cmd (prefs.editor + wxT(" ") + args); + wxString cmd(prefs.editor + wxT(" ") + args); wxString msg; - msg.Printf (_("Execute editor: %s"), cmd.c_str ()); - Trace (msg); + msg.Printf(_("Execute editor: %s"), cmd.c_str()); + Trace(msg); - ActionEvent::Post (m->parent, TOKEN_CMD_VIEW, cmd); + ActionEvent::Post(m->parent, TOKEN_CMD_VIEW, cmd); return true; } bool -ViewAction::CheckStatusSel (const svn::StatusSel & statusSel) +ViewAction::CheckStatusSel(const svn::StatusSel & statusSel) { - if (1 != statusSel.size ()) + if (1 != statusSel.size()) return false; - if (statusSel.hasDirs ()) + if (statusSel.hasDirs()) return false; return true; diff --git a/src/view_action.hpp b/src/view_action.hpp index 115c45d1..c1948d60 100644 --- a/src/view_action.hpp +++ b/src/view_action.hpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the file GPL.txt. + * along with this program (in the file GPL.txt. * If not, see . * * This software consists of voluntary contributions made by many @@ -34,8 +34,8 @@ namespace svn } /** - * This action downloads a specific revision - * of a file (specified in @a GetData) and + * This action downloads a specific revision + * of a file (specified in @a GetData) and * displays the file */ class ViewAction:public Action @@ -51,24 +51,24 @@ class ViewAction:public Action * @param title title of the action * @param data update data */ - ViewAction (wxWindow * parent, - const GetData & data); + ViewAction(wxWindow * parent, + const GetData & data); /** - * Constructor. + * Constructor. * An editor for the target will be called. */ - ViewAction (wxWindow * parent); + ViewAction(wxWindow * parent); - virtual bool - Perform (); - - virtual bool - Prepare (); - + virtual bool + Perform(); + + virtual bool + Prepare(); + static bool - CheckStatusSel (const svn::StatusSel & statusSel); + CheckStatusSel(const svn::StatusSel & statusSel); private: