[gtksourceviewmm] SourceLanuageManager::guess_language(): Correct the reference counting.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceviewmm] SourceLanuageManager::guess_language(): Correct the reference counting.
- Date: Tue, 6 Apr 2010 07:40:35 +0000 (UTC)
commit 9c51f7ad94e91e85a32ec51ef34939da17852e86
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Apr 6 09:40:22 2010 +0200
SourceLanuageManager::guess_language(): Correct the reference counting.
* gtksourceview/src/sourcelanguagemanager.hg: guess_language(): Use
refreturn. This fixes a crash in regexxer.
* gtksourceview/src/sourcebuffer.hg: get_undo_manager():
Use refreturn with _WRAP_METHOD() and actually implement (via _WRAP_METHOD),
the const overload.
* gtksourceview/src/sourcecompletion.hg:
* gtksourceview/src/sourcecompletionprovider.hg:
* gtksourceview/src/sourcelanguage.hg: Added some TODOs for minor stuff that
I noticed while making these changes.
gtksourceview/src/sourcebuffer.hg | 4 ++--
gtksourceview/src/sourcecompletion.hg | 2 ++
gtksourceview/src/sourcecompletionprovider.hg | 1 +
gtksourceview/src/sourcelanguage.hg | 1 +
gtksourceview/src/sourcelanguagemanager.hg | 4 ++--
5 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtksourceview/src/sourcebuffer.hg b/gtksourceview/src/sourcebuffer.hg
index 6ae8b62..24567aa 100644
--- a/gtksourceview/src/sourcebuffer.hg
+++ b/gtksourceview/src/sourcebuffer.hg
@@ -399,14 +399,14 @@ public:
*
* @newin{2,10}
*/
- _WRAP_METHOD(Glib::RefPtr<SourceUndoManager> get_undo_manager(), gtk_source_buffer_get_undo_manager)
+ _WRAP_METHOD(Glib::RefPtr<SourceUndoManager> get_undo_manager(), gtk_source_buffer_get_undo_manager, refreturn)
/** Get the undo manager associated with the buffer.
* @return A SourceUndoManager.
*
* @newin{2,10}
*/
- _WRAP_METHOD(Glib::RefPtr<const SourceUndoManager> get_undo_manager() const, gtk_source_buffer_get_undo_manager, constversion)
+ _WRAP_METHOD(Glib::RefPtr<const SourceUndoManager> get_undo_manager() const, gtk_source_buffer_get_undo_manager, refreturn, constversion)
/** Set the buffer undo manager.
*
diff --git a/gtksourceview/src/sourcecompletion.hg b/gtksourceview/src/sourcecompletion.hg
index 156e0da..0115674 100644
--- a/gtksourceview/src/sourcecompletion.hg
+++ b/gtksourceview/src/sourcecompletion.hg
@@ -98,6 +98,7 @@ public:
*/
_WRAP_METHOD(void hide(), gtk_source_completion_hide)
+ //TODO: This should not be const. There should be an extra const overload.
/** Gets the SourceCompletionInfo window.
*
* The info widget is the window where the completion displays optional extra information of the proposal.
@@ -108,6 +109,7 @@ public:
*/
_WRAP_METHOD(SourceCompletionInfo* get_info_window() const, gtk_source_completion_get_info_window)
+ //TODO: This should not be const. There should be an extra const overload.
/** Gets the SourceView associated with completion.
*
* @return The SourceView associated with completion.
diff --git a/gtksourceview/src/sourcecompletionprovider.hg b/gtksourceview/src/sourcecompletionprovider.hg
index a28b025..d04923b 100644
--- a/gtksourceview/src/sourcecompletionprovider.hg
+++ b/gtksourceview/src/sourcecompletionprovider.hg
@@ -83,6 +83,7 @@ public:
*/
_WRAP_METHOD(bool match(const Glib::RefPtr<const SourceCompletionContext>& context) const, gtk_source_completion_provider_match)
+ //TODO: This should not be const. There should be an extra const overload.
/** Get a customized info widget to show extra information of a proposal.
*
* This allows for customized widgets on a proposal basis, although in general
diff --git a/gtksourceview/src/sourcelanguage.hg b/gtksourceview/src/sourcelanguage.hg
index 37060c9..89f92a1 100644
--- a/gtksourceview/src/sourcelanguage.hg
+++ b/gtksourceview/src/sourcelanguage.hg
@@ -75,6 +75,7 @@ public:
*/
_WRAP_METHOD(Glib::ustring get_section() const, gtk_source_language_get_section)
+ //TODO: THis should return bool, not gboolean.
/** Returns whether the language should be hidden from the user.
*
* @return @c true if the language should be hidden, @c false otherwise.
diff --git a/gtksourceview/src/sourcelanguagemanager.hg b/gtksourceview/src/sourcelanguagemanager.hg
index 40b94c6..96db8aa 100644
--- a/gtksourceview/src/sourcelanguagemanager.hg
+++ b/gtksourceview/src/sourcelanguagemanager.hg
@@ -166,7 +166,7 @@ public:
* @return A SourceLanguage, or empty Glib::RefPtr if there is no suitable
* language for given @a filename and/or @a content_type.
*/
- _WRAP_METHOD(Glib::RefPtr<SourceLanguage> guess_language(const Glib::ustring& filename, const Glib::ustring& content_type), gtk_source_language_manager_guess_language)
+ _WRAP_METHOD(Glib::RefPtr<SourceLanguage> guess_language(const Glib::ustring& filename, const Glib::ustring& content_type), gtk_source_language_manager_guess_language, refreturn)
/** Picks a SourceLanguage for given file name and content type,
* according to the information in lang files.
@@ -214,7 +214,7 @@ public:
* @return A SourceLanguage, or empty Glib::RefPtr if there is no suitable
* language for given @a filename and/or @a content_type.
*/
- Glib::RefPtr<const SourceLanguage> guess_language(const Glib::ustring& filename, const Glib::ustring& content_type) const;
+ _WRAP_METHOD(Glib::RefPtr<const SourceLanguage> guess_language(const Glib::ustring& filename, const Glib::ustring& content_type) const, gtk_source_language_manager_guess_language, refreturn, constversion)
};
} /* namespace gtksourceview */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]