[gnome-subtitles] Path now only returns a path if only 1 path is selected
- From: Pedro Daniel da Rocha Melo e Castro <pcastro src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-subtitles] Path now only returns a path if only 1 path is selected
- Date: Sat, 23 May 2009 07:43:54 -0400 (EDT)
commit 864ff379eeca7569c8f7d0dda100d280a94978d5
Author: Pedro Castro <mail pedrocastro org>
Date: Sat May 23 12:37:05 2009 +0100
Path now only returns a path if only 1 path is selected
---
src/GnomeSubtitles/Ui/View/SubtitleSelection.cs | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/GnomeSubtitles/Ui/View/SubtitleSelection.cs b/src/GnomeSubtitles/Ui/View/SubtitleSelection.cs
index f525ffd..cd9ccc9 100644
--- a/src/GnomeSubtitles/Ui/View/SubtitleSelection.cs
+++ b/src/GnomeSubtitles/Ui/View/SubtitleSelection.cs
@@ -78,9 +78,15 @@ public class SubtitleSelection {
}
/// <summary>The selected path.</summary>
- /// <remarks>If there is more than one path selected, the first is returned.</remarks>
+ /// <remarks>If there is more than one path selected, null is returned.</remarks>
public TreePath Path {
- get { return FirstPath; }
+ get {
+ TreePath[] paths = Paths;
+ if (paths.Length == 1)
+ return paths[0];
+ else
+ return null;
+ }
}
/// <summary>The range of selected subtitles, an array with 2 positions containing the first and last paths of the selection.</summary>
@@ -129,11 +135,11 @@ public class SubtitleSelection {
}
}
- /// <summary>The selected subtitle. If there is more than one selected, the first is returned.</summary>
public Subtitle Subtitle {
get { return subtitle; }
}
+ /// <summary>The selected subtitle. If there is more than one selected, the first is returned.</summary>
public Subtitle FirstSubtitle {
get {
TreePath path = this.FirstPath;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]