diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-08 18:16:12 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-08 18:16:12 +0000 |
commit | 42db44c1939410aab15eb3c0d08f6026fb58b003 (patch) | |
tree | f609009ae5823ae34100c272cb873a35ac8086ba /gtk2_ardour/route_time_axis.cc | |
parent | 752d8d4b6f2f28fdd3fc810cfd956e4bec5b9ef8 (diff) |
merge 3870-3890 from 2.0-ongoing into 3.X (compiles, runs, no other promises
git-svn-id: svn://localhost/ardour2/branches/3.0@4303 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 8985e85071..a36a6bc35a 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -960,33 +960,30 @@ RouteTimeAxisView::resolve_new_group_playlist_name(std::string &basename, vector std::string group_string = "."+edit_group()->name()+"."; - if (basename.find(group_string) == string::npos) { - int maxnumber = 0; - - // iterate through all playlists - for (vector<boost::shared_ptr<Playlist> >::const_iterator i = playlists.begin(); i != playlists.end(); ++i) { - std::string tmp = (*i)->name(); - - std::string::size_type idx = tmp.find(group_string); - // find those which belong to this group - if (idx != string::npos) { - tmp = tmp.substr(idx + group_string.length()); - - // and find the largest current number - int x = atoi(tmp.c_str()); - if (x > maxnumber) { - maxnumber = x; - } + // iterate through all playlists + int maxnumber = 0; + for (vector<boost::shared_ptr<Playlist> >::const_iterator i = playlists.begin(); i != playlists.end(); ++i) { + std::string tmp = (*i)->name(); + + std::string::size_type idx = tmp.find(group_string); + // find those which belong to this group + if (idx != string::npos) { + tmp = tmp.substr(idx + group_string.length()); + + // and find the largest current number + int x = atoi(tmp.c_str()); + if (x > maxnumber) { + maxnumber = x; } } + } - maxnumber++; + maxnumber++; - char buf[32]; - snprintf (buf, sizeof(buf), "%d", maxnumber); + char buf[32]; + snprintf (buf, sizeof(buf), "%d", maxnumber); - ret = this->name()+"."+edit_group()->name()+"."+buf; - } + ret = this->name()+"."+edit_group()->name()+"."+buf; return ret; } |