Commit b2c0905b authored by Daniel Elstner's avatar Daniel Elstner
Browse files

Minor code reformatting: Change instances of <foo,bar> in template

* src/controller.h: Minor code reformatting: Change instances
of <foo,bar> in template argument lists to <foo, bar>.
* src/filebuffer.{cc,h}: ditto,
* src/fileshared.{cc,h}: ditto,
* src/filetree.h: ditto,
* src/filetreeprivate.{cc,h}: ditto,
* src/pcreshell.{cc,h}: ditto.
* src/mainwindow.cc (program_license): Add terminating newline
to last paragraph.

svn path=/trunk/; revision=651
parent 088de0bc
2007-02-18 Daniel Elstner <daniel.kitta@gmail.com>
* src/controller.h: Minor code reformatting: Change instances
of <foo,bar> in template argument lists to <foo, bar>.
* src/filebuffer.{cc,h}: ditto,
* src/fileshared.{cc,h}: ditto,
* src/filetree.h: ditto,
* src/filetreeprivate.{cc,h}: ditto,
* src/pcreshell.{cc,h}: ditto.
* src/mainwindow.cc (program_license): Add terminating newline
to last paragraph.
2007-02-18 Daniel Elstner <daniel.kitta@gmail.com>
* src/stringutils.{cc,h} (Util::wstring_to_utf8): New function to
......
......@@ -58,10 +58,10 @@ public:
bool is_enabled() const;
private:
sigc::signal<void> signal_activate_;
sigc::signal<void,bool> signal_set_sensitive_;
bool enabled_;
bool group_enabled_;
sigc::signal<void> signal_activate_;
sigc::signal<void, bool> signal_set_sensitive_;
bool enabled_;
bool group_enabled_;
ControlItem(const ControlItem&);
ControlItem& operator=(const ControlItem&);
......@@ -78,8 +78,8 @@ public:
void set_enabled(bool enable);
private:
sigc::signal<void,bool> signal_set_enabled_;
bool enabled_;
sigc::signal<void, bool> signal_set_enabled_;
bool enabled_;
ControlGroup(const ControlGroup&);
ControlGroup& operator=(const ControlGroup&);
......
......@@ -255,7 +255,7 @@ bool FileBuffer::in_user_action() const
* multiple matches per line will be found (like modifier /g in Perl).
*/
int FileBuffer::find_matches(Pcre::Pattern& pattern, bool multiple,
const sigc::slot<void,int,const Glib::ustring&>& feedback)
const sigc::slot<void, int, const Glib::ustring&>& feedback)
{
ScopedLock lock (*this);
......@@ -312,7 +312,7 @@ int FileBuffer::find_matches(Pcre::Pattern& pattern, bool multiple,
++match_count_;
++original_match_count_;
const std::pair<int,int> bounds = pattern.get_substring_bounds(0);
const std::pair<int, int> bounds = pattern.get_substring_bounds(0);
iterator start = line;
iterator stop = line;
......@@ -517,7 +517,7 @@ void FileBuffer::decrement_stamp()
void FileBuffer::undo_remove_match(const MatchDataPtr& match, int offset)
{
const std::pair<MatchSet::iterator,bool> pos = match_set_.insert(match);
const std::pair<MatchSet::iterator, bool> pos = match_set_.insert(match);
g_return_if_fail(pos.second);
const iterator start = get_iter_at_offset(offset);
......
......@@ -51,7 +51,7 @@ public:
bool in_user_action() const;
int find_matches(Pcre::Pattern& pattern, bool multiple,
const sigc::slot<void,int,const Glib::ustring&>& feedback);
const sigc::slot<void, int, const Glib::ustring&>& feedback);
int get_match_count() const;
int get_match_index() const;
......@@ -78,7 +78,7 @@ public:
sigc::signal<void> signal_bound_state_changed;
Util::QueuedSignal signal_preview_line_changed;
sigc::signal<bool> signal_pulse;
sigc::signal<void,UndoActionPtr> signal_undo_stack_push;
sigc::signal<void, UndoActionPtr> signal_undo_stack_push;
protected:
FileBuffer();
......@@ -96,7 +96,7 @@ private:
class ScopedLock;
class ScopedUserAction;
typedef std::set<MatchDataPtr,MatchDataLess> MatchSet;
typedef std::set<MatchDataPtr, MatchDataLess> MatchSet;
typedef std::stack<FileBufferActionRemoveMatch*> WeakUndoStack;
MatchSet match_set_;
......
......@@ -40,7 +40,7 @@ const Glib::Quark& file_buffer_match_quark()
}
static
int calculate_match_length(const Glib::ustring& subject, const std::pair<int,int>& bounds)
int calculate_match_length(const Glib::ustring& subject, const std::pair<int, int>& bounds)
{
const std::string::const_iterator begin = subject.begin().base();
......
......@@ -72,11 +72,11 @@ inline BoundState& operator^=(BoundState& a, BoundState b)
*/
struct MatchData : public Util::SharedObject
{
int index;
int length;
Glib::ustring subject;
std::vector< std::pair<int,int> > captures;
Glib::RefPtr<Gtk::TextMark> mark;
int index;
int length;
Glib::ustring subject;
std::vector< std::pair<int, int> > captures;
Glib::RefPtr<Gtk::TextMark> mark;
MatchData(int match_index, const Glib::ustring& line,
const Pcre::Pattern& pattern, int capture_count);
......
......@@ -66,13 +66,13 @@ public:
int get_modified_count() const;
sigc::signal<void,FileInfoPtr,int> signal_switch_buffer;
sigc::signal<void> signal_bound_state_changed;
sigc::signal<void> signal_file_count_changed;
sigc::signal<void> signal_match_count_changed;
sigc::signal<void> signal_modified_count_changed;
sigc::signal<bool> signal_pulse;
sigc::signal<void,UndoActionPtr> signal_undo_stack_push;
sigc::signal<void, FileInfoPtr, int> signal_switch_buffer;
sigc::signal<void> signal_bound_state_changed;
sigc::signal<void> signal_file_count_changed;
sigc::signal<void> signal_match_count_changed;
sigc::signal<void> signal_modified_count_changed;
sigc::signal<bool> signal_pulse;
sigc::signal<void, UndoActionPtr> signal_undo_stack_push;
// Provide line number, subject and file info for match location output.
sigc::signal<void, int, const Glib::ustring&, FileInfoPtr> signal_feedback;
......
......@@ -23,7 +23,6 @@
#include <glib.h>
#include <gtkmm/treestore.h>
namespace Regexxer
{
......@@ -68,8 +67,9 @@ bool next_match_file(Gtk::TreeModel::iterator& iter, Gtk::TreeModel::Path* colla
const FileTreeColumns& columns = FileTreeColumns::instance();
Gtk::TreeModel::iterator parent = iter->parent();
++iter;
for (++iter;;)
for (;;)
{
if (iter)
{
......@@ -121,7 +121,7 @@ bool prev_match_file(Gtk::TreeModel::iterator& iter, Gtk::TreeModel::Path* colla
if (const Gtk::TreeModel::Children& children = iter->children()) // directory?
{
parent = iter;
path.push_back(children.size());
path.push_back(children.size()); // one beyond the last child
continue;
}
......@@ -194,10 +194,10 @@ const std::list<Glib::ustring>& FileTree::Error::get_error_list() const
FileTree::FindData::FindData(Pcre::Pattern& pattern_, bool recursive_, bool hidden_)
:
pattern (pattern_),
recursive (recursive_),
hidden (hidden_),
error_list (new FileTree::MessageList())
pattern (pattern_),
recursive (recursive_),
hidden (hidden_),
error_list (new FileTree::MessageList())
{}
FileTree::FindData::~FindData()
......@@ -277,10 +277,10 @@ bool FileTree::BufferActionShell::do_undo(const sigc::slot<bool>& pulse)
{
g_return_val_if_fail(row_reference_->is_valid(), false);
const Gtk::TreePath path (row_reference_->get_path());
const Gtk::TreeModel::Path path = row_reference_->get_path();
if (!filetree_.last_selected_rowref_ ||
filetree_.last_selected_rowref_->get_path() != path)
if (!filetree_.last_selected_rowref_
|| filetree_.last_selected_rowref_->get_path() != path)
{
filetree_.expand_and_select(path);
}
......
......@@ -68,8 +68,8 @@ int collatekey_sort_func(const Gtk::TreeModel::iterator& a, const Gtk::TreeModel
bool next_match_file(Gtk::TreeModel::iterator& iter, Gtk::TreeModel::Path* collapse = 0);
bool prev_match_file(Gtk::TreeModel::iterator& iter, Gtk::TreeModel::Path* collapse = 0);
typedef std::pair<std::string,Gtk::TreeModel::iterator> DirNodePair;
typedef std::list<DirNodePair> DirStack;
typedef std::pair<std::string, Gtk::TreeModel::iterator> DirNodePair;
typedef std::list<DirNodePair> DirStack;
class ScopedPushDir
{
......@@ -153,7 +153,7 @@ struct FileTree::ReplaceMatchesData
const Glib::ustring substitution;
FileTree::TreeRowRefPtr row_reference;
UndoStackPtr undo_stack;
const sigc::slot<void,UndoActionPtr> slot_undo_stack_push;
const sigc::slot<void, UndoActionPtr> slot_undo_stack_push;
void undo_stack_push(UndoActionPtr undo_action);
......
......@@ -69,7 +69,7 @@ static const char *const program_license =
"\n"
"You should have received a copy of the GNU General Public License "
"along with regexxer; if not, write to the Free Software Foundation, "
"Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA";
"Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n";
class FileErrorDialog : public Gtk::MessageDialog
{
......
......@@ -173,7 +173,7 @@ int Pattern::match(const Glib::ustring& subject, int offset, MatchOptions option
g_return_val_if_reached(captures);
}
std::pair<int,int> Pattern::get_substring_bounds(int index) const
std::pair<int, int> Pattern::get_substring_bounds(int index) const
{
g_return_val_if_fail(index >= 0 && 3 * index < ovecsize_, std::make_pair(-1, -1));
......@@ -182,7 +182,7 @@ std::pair<int,int> Pattern::get_substring_bounds(int index) const
Glib::ustring Pattern::get_substring(const Glib::ustring& subject, int index) const
{
const std::pair<int,int> bounds = get_substring_bounds(index);
const std::pair<int, int> bounds = get_substring_bounds(index);
if (bounds.first >= 0 && bounds.first < bounds.second)
{
......
......@@ -131,7 +131,7 @@ public:
int match(const Glib::ustring& subject, int offset = 0, MatchOptions options = MatchOptions(0));
// returns byte offsets
std::pair<int,int> get_substring_bounds(int index) const;
std::pair<int, int> get_substring_bounds(int index) const;
Glib::ustring get_substring(const Glib::ustring& subject, int index) const;
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment