[solang] Carried out some housekeeping.



commit 286cf643c3ffd05223beee2cfb60418e265cf81a
Author: Debarshi Ray <rishi gnu org>
Date:   Mon Jan 25 22:51:33 2010 +0200

    Carried out some housekeeping.
    
    + Fixed whitespaces and indentation.
    + Fixed copyright and license notices.
    + Typedefed some pointer types.
    + Used HAVE_CONFIG_H around #include "config.h".

 src/attribute/basic-exif-view.cpp     |    4 +-
 src/attribute/date-view.cpp           |    2 +-
 src/attribute/search-basket.cpp       |   13 ++---
 src/attribute/tag-manager.cpp         |   12 +---
 src/attribute/tag-manager.h           |  113 +++++++++++++++++----------------
 src/attribute/tag-view.cpp            |   19 +++---
 src/attribute/tag-view.h              |   13 ++--
 src/common/types.h                    |    4 +
 src/importer/camera-import-widget.cpp |    2 +-
 9 files changed, 89 insertions(+), 93 deletions(-)
---
diff --git a/src/attribute/basic-exif-view.cpp b/src/attribute/basic-exif-view.cpp
index 6c3b8df..04fda6d 100644
--- a/src/attribute/basic-exif-view.cpp
+++ b/src/attribute/basic-exif-view.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 /*
- * Copyright (C) 2009 Debarshi Ray <rishi gnu org>
+ * Copyright (C) 2009, 2010 Debarshi Ray <rishi gnu org>
  * Copyright (C) 2009 Santanu Sinha <santanu sinha gmail com>
  *
  * Solang is free software: you can redistribute it and/or modify it
@@ -252,7 +252,7 @@ BasicExifView::on_drag_data_get(
     {
         return;
     }
-    Glib::RefPtr<Gtk::TreeSelection> selected = get_selection();
+    const TreeSelectionPtr selected = get_selection();
     if( 0 == selected->count_selected_rows() )
         return;
 
diff --git a/src/attribute/date-view.cpp b/src/attribute/date-view.cpp
index 053c1e8..5330a89 100644
--- a/src/attribute/date-view.cpp
+++ b/src/attribute/date-view.cpp
@@ -165,7 +165,7 @@ DateView::on_drag_data_get(
     {
         return;
     }
-    Glib::RefPtr<Gtk::TreeSelection> selected = get_selection();
+    const TreeSelectionPtr selected = get_selection();
     if( 0 == selected->count_selected_rows() )
         return;
 
diff --git a/src/attribute/search-basket.cpp b/src/attribute/search-basket.cpp
index 4da3f8f..221c0ec 100644
--- a/src/attribute/search-basket.cpp
+++ b/src/attribute/search-basket.cpp
@@ -102,8 +102,7 @@ SearchBasket::SearchBasket() throw() :
     SearchBasketColumnRecord tmp;
     treeView_.set_tooltip_column( tmp.get_column_description_num() );
 
-    const Glib::RefPtr<Gtk::TreeSelection> selection
-        = treeView_.get_selection();
+    const TreeSelectionPtr selection = treeView_.get_selection();
     selection->set_mode(Gtk::SELECTION_MULTIPLE);
 
     scrolledWindow_.add(treeView_);
@@ -201,16 +200,14 @@ SearchBasket::visit_renderer(SlideshowRenderer & slideshow_renderer)
 void
 SearchBasket::on_action_select_all() throw()
 {
-    const Glib::RefPtr<Gtk::TreeSelection> selection
-        = treeView_.get_selection();
+    const TreeSelectionPtr selection = treeView_.get_selection();
     selection->select_all();
 }
 
 void
 SearchBasket::on_action_remove_selected() throw()
 {
-    const Glib::RefPtr<Gtk::TreeSelection> selection
-        = treeView_.get_selection();
+    const ConstTreeSelectionPtr selection = treeView_.get_selection();
 
     const TreePathList selected_rows = selection->get_selected_rows();
 
@@ -255,8 +252,8 @@ SearchBasket::on_button_press_event(GdkEventButton * event) throw()
         {
             action->set_visible(true);
 
-            const Glib::RefPtr<Gtk::TreeSelection> selection
-                = treeView_.get_selection();
+            const TreeSelectionPtr selection
+                                       = treeView_.get_selection();
 
             if (false == selection->is_selected(path))
             {
diff --git a/src/attribute/tag-manager.cpp b/src/attribute/tag-manager.cpp
index 8ed866c..a8ee53b 100644
--- a/src/attribute/tag-manager.cpp
+++ b/src/attribute/tag-manager.cpp
@@ -275,8 +275,7 @@ TagManager::on_action_tag_new() throw()
 void
 TagManager::on_action_tag_edit() throw()
 {
-    Glib::RefPtr<Gtk::TreeSelection> selected
-                                            = tagView_.get_selection();
+    const ConstTreeSelectionPtr selected = tagView_.get_selection();
 
     const TagViewModelColumnRecord &rec
                                 = tagView_.get_column_records();
@@ -329,8 +328,7 @@ TagManager::on_action_tag_edit() throw()
 void
 TagManager::on_action_tag_delete() throw()
 {
-    Glib::RefPtr<Gtk::TreeSelection> selected
-                                            = tagView_.get_selection();
+    const ConstTreeSelectionPtr selected = tagView_.get_selection();
 
     const TagViewModelColumnRecord &rec
                                 = tagView_.get_column_records();
@@ -357,8 +355,7 @@ TagManager::on_action_tag_delete() throw()
 void
 TagManager::on_action_apply_tag() throw()
 {
-    Glib::RefPtr<Gtk::TreeSelection> selected
-                                            = tagView_.get_selection();
+    const TreeSelectionPtr selected = tagView_.get_selection();
     Gtk::TreeModel::iterator item = selected->get_selected();
 
     if (false == item)
@@ -393,8 +390,7 @@ TagManager::on_action_apply_tag() throw()
 void
 TagManager::on_action_remove_tag() throw()
 {
-    Glib::RefPtr<Gtk::TreeSelection> selected
-                                            = tagView_.get_selection();
+    const TreeSelectionPtr selected = tagView_.get_selection();
     Gtk::TreeModel::iterator item = selected->get_selected();
 
     if (false == item)
diff --git a/src/attribute/tag-manager.h b/src/attribute/tag-manager.h
index 677a8a9..a184962 100644
--- a/src/attribute/tag-manager.h
+++ b/src/attribute/tag-manager.h
@@ -1,17 +1,17 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 /*
- * Copyright (C) 2009 Debarshi Ray <rishi gnu org>
- * 
+ * Copyright (C) 2009, 2010 Debarshi Ray <rishi gnu org>
+ *
  * Solang is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  * Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
- * 
+ *
  * Solang is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along
  * with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
@@ -37,89 +37,90 @@ class RendererRegistry;
 class TagManager :
     public Plugin
 {
-public:
-    TagManager() throw();
+    public:
+        TagManager() throw();
 
-    virtual
-    ~TagManager() throw();
+        virtual
+        ~TagManager() throw();
 
-    virtual void
-    init(Application & application) throw();
+        virtual void
+        init(Application & application) throw();
 
-    virtual void
-    final(Application & application) throw();
+        virtual void
+        final(Application & application) throw();
 
-    virtual void
-    visit_renderer(BrowserRenderer & browser_renderer) throw();
+        virtual void
+        visit_renderer(BrowserRenderer & browser_renderer) throw();
 
-    virtual void
-    visit_renderer(ConsoleRenderer & console_renderer) throw();
+        virtual void
+        visit_renderer(ConsoleRenderer & console_renderer) throw();
 
-    virtual void
-    visit_renderer(EnlargedRenderer & enlarged_renderer) throw();
+        virtual void
+        visit_renderer(EnlargedRenderer & enlarged_renderer) throw();
 
-    virtual void
-    visit_renderer(SlideshowRenderer & slideshow_renderer) throw();
+        virtual void
+        visit_renderer(SlideshowRenderer & slideshow_renderer) throw();
 
-protected:
-    void
-    on_action_tag_new() throw();
+    protected:
+        void
+        on_action_tag_new() throw();
 
-    void
-    on_action_tag_edit() throw();
+        void
+        on_action_tag_edit() throw();
 
-    void
-    on_action_tag_delete() throw();
+        void
+        on_action_tag_delete() throw();
 
-    void
-    on_action_apply_tag() throw();
+        void
+        on_action_apply_tag() throw();
 
-    void
-    on_action_remove_tag() throw();
+        void
+        on_action_remove_tag() throw();
 
-    void
-    on_get_tags(TagList & tags) throw();
+        void
+        on_get_tags(TagList & tags) throw();
 
-    void
-    on_renderer_changed(RendererRegistry & renderer_registry) throw();
+        void
+        on_renderer_changed(RendererRegistry & renderer_registry)
+                            throw();
 
-    void
-    on_updated_tag() throw();
+        void
+        on_updated_tag() throw();
 
-    void
-    populate_view() throw();
+        void
+        populate_view() throw();
 
-    void
-    ui_hide() throw();
+        void
+        ui_hide() throw();
 
-    void
-    ui_show() throw();
+        void
+        ui_show() throw();
 
-    ApplicationPtr application_;
+        ApplicationPtr application_;
 
-    IconFactoryPtr iconFactory_;
+        IconFactoryPtr iconFactory_;
 
-    ActionGroupPtr actionGroup_;
+        ActionGroupPtr actionGroup_;
 
-    Gtk::UIManager::ui_merge_id uiID_;
+        Gtk::UIManager::ui_merge_id uiID_;
 
-    const std::string dockItemName_;
+        const std::string dockItemName_;
 
-    const Glib::ustring dockItemTitle_;
+        const Glib::ustring dockItemTitle_;
 
-    GdlDockItemBehavior dockItemBehaviour_;
+        GdlDockItemBehavior dockItemBehaviour_;
 
-    GtkWidget * dockItem_;
+        GtkWidget * dockItem_;
 
-    Gtk::VBox vBox_;
+        Gtk::VBox vBox_;
 
-    Gtk::ScrolledWindow scrolledWindow_;
+        Gtk::ScrolledWindow scrolledWindow_;
 
-    TagView tagView_;
+        TagView tagView_;
 
-    sigc::connection signalRendererChanged_;
+        sigc::connection signalRendererChanged_;
 
-private:
+    private:
 };
 
 } // namespace Solang
diff --git a/src/attribute/tag-view.cpp b/src/attribute/tag-view.cpp
index 850ae3a..ec4d355 100644
--- a/src/attribute/tag-view.cpp
+++ b/src/attribute/tag-view.cpp
@@ -1,25 +1,24 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 /*
- * tag-view.cpp
- * Copyright (C) Debarshi Ray 2009 <rishi gnu org>
- * 
- * tag-view.cpp is free software: you can redistribute it and/or modify it
+ * Copyright (C) 2009, 2010 Debarshi Ray <rishi gnu org>
+ *
+ * Solang is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  * Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
- * 
- * tag-view.cpp is distributed in the hope that it will be useful, but
+ *
+ * Solang is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along
  * with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
-
-#include<iostream>
+#endif // HAVE_CONFIG_H
 
 #include "application.h"
 #include "tag.h"
@@ -180,7 +179,7 @@ TagView::on_drag_data_get(
     {
         return;
     }
-    Glib::RefPtr<Gtk::TreeSelection> selected = get_selection();
+    const TreeSelectionPtr selected = get_selection();
     if( 0 == selected->count_selected_rows() )
         return;
 
diff --git a/src/attribute/tag-view.h b/src/attribute/tag-view.h
index 63ec358..ed0e03b 100644
--- a/src/attribute/tag-view.h
+++ b/src/attribute/tag-view.h
@@ -1,18 +1,17 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 /*
- * tag-view.h
- * Copyright (C) Debarshi Ray 2009 <rishi gnu org>
- * 
- * tag-view.h is free software: you can redistribute it and/or modify it
+ * Copyright (C) 2009, 2010 Debarshi Ray <rishi gnu org>
+ *
+ * Solang is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  * Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
- * 
- * tag-view.h is distributed in the hope that it will be useful, but
+ *
+ * Solang is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along
  * with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
diff --git a/src/common/types.h b/src/common/types.h
index 879a0a8..5d9df49 100644
--- a/src/common/types.h
+++ b/src/common/types.h
@@ -71,6 +71,7 @@ class ToggleAction;
 class TreeModel;
 class TreeModelFilter;
 class TreePath;
+class TreeSelection;
 class TreeStore;
 class UIManager;
 
@@ -330,6 +331,9 @@ typedef Glib::RefPtr<Gtk::TreeModelFilter> TreeModelFilterPtr;
 
 typedef std::vector<Gtk::TreePath> TreePathList;
 
+typedef Glib::RefPtr<const Gtk::TreeSelection> ConstTreeSelectionPtr;
+typedef Glib::RefPtr<Gtk::TreeSelection> TreeSelectionPtr;
+
 typedef Glib::RefPtr<const Gtk::UIManager> ConstUIManagerPtr;
 typedef Glib::RefPtr<Gtk::UIManager> UIManagerPtr;
 
diff --git a/src/importer/camera-import-widget.cpp b/src/importer/camera-import-widget.cpp
index 50f13d2..c2ba485 100644
--- a/src/importer/camera-import-widget.cpp
+++ b/src/importer/camera-import-widget.cpp
@@ -454,7 +454,7 @@ CameraImportWidget::CameraImportWidget(GPhotoContext &context)
     photos_.set_policy(
             Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC );
     cameraPhotos_.set_model( picturesModel_ );
-    Glib::RefPtr<Gtk::TreeSelection> refTreeSelection
+    const TreeSelectionPtr refTreeSelection
                                 = cameraPhotos_.get_selection();
     refTreeSelection->set_mode( Gtk::SELECTION_MULTIPLE);
     selectAll_.set_size_request( 90, -1 );



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]