hipo r141 - in trunk: . src
- From: bgarret svn gnome org
- To: svn-commits-list gnome org
- Subject: hipo r141 - in trunk: . src
- Date: Fri, 11 Jan 2008 20:51:24 +0000 (GMT)
Author: bgarret
Date: Fri Jan 11 20:51:24 2008
New Revision: 141
URL: http://svn.gnome.org/viewvc/hipo?rev=141&view=rev
Log:
2008-01-11 Benoit Garret <benoit garret_gnome gadz org>
* src/TracksView.cs: make AddFolder return the
correct value.
Fixes #508576
Modified:
trunk/ChangeLog
trunk/src/TracksView.cs
Modified: trunk/src/TracksView.cs
==============================================================================
--- trunk/src/TracksView.cs (original)
+++ trunk/src/TracksView.cs Fri Jan 11 20:51:24 2008
@@ -118,6 +118,9 @@
public bool AddFolder (TrackDatabase db, string[] dirs)
{
+ // returns true if at least one track has been added
+ bool trackAdded = false;
+
foreach (string path in dirs)
{
if (path == null)
@@ -128,16 +131,17 @@
UnixDirectoryInfo info = new UnixDirectoryInfo (uri.LocalPath);
foreach (UnixFileSystemInfo file in info.GetFileSystemEntries ())
{
+ // |= gives true as soon as one of the arguments is true
if (!file.IsDirectory) {
- AddTrack (db, file.FullName);
+ trackAdded |= AddTrack (db, file.FullName);
} else {
string[] tmp = { file.FullName };
- AddFolder (db, tmp);
+ trackAdded |= AddFolder (db, tmp);
}
}
}
- return true;
+ return trackAdded;
}
public bool RemoveTracks (TrackDatabase db, long tracksId)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]