Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7a875d97 authored by Frerich Raabe's avatar Frerich Raabe

- When creating a playlist from a directory, suggest the directory's name

  as the playlist name.

svn path=/trunk/kdemultimedia/juk/; revision=243218
parent 54c6befb
......@@ -292,6 +292,11 @@ void JuK::setupActions()
KActionMenu *newMenu = new KActionMenu(i18n("&New"), "filenew",
actionCollection(), "file_new");
/* This connection will call the
* PlaylistSplitter::slotCreatePlaylist(const QString &) slot - this is
* possible because the QString parameter has a default value, so the
* slot can be called without arguments (as required by the signal's
* signature). */
newMenu->insert(createSplitterAction(i18n("Empty Playlist..."),
SLOT(slotCreatePlaylist()), 0, 0, 0));
......
......@@ -301,7 +301,7 @@ void PlaylistSplitter::slotOpenDirectory()
}
}
Playlist *PlaylistSplitter::slotCreatePlaylist()
Playlist *PlaylistSplitter::slotCreatePlaylist(const QString &name_)
{
bool ok;
......@@ -309,7 +309,7 @@ Playlist *PlaylistSplitter::slotCreatePlaylist()
QString name = KInputDialog::getText(i18n("Create New Playlist"),
i18n("Please enter a name for the new playlist:"),
uniquePlaylistName(), &ok);
name_.isNull() ? uniquePlaylistName() : name_, &ok);
if(ok)
return createPlaylist(name);
else
......@@ -322,7 +322,7 @@ Playlist *PlaylistSplitter::slotCreatePlaylistFromDir()
if(dirName.isEmpty())
return 0;
Playlist *playlist = slotCreatePlaylist();
Playlist *playlist = slotCreatePlaylist(dirName.mid(dirName.findRev('/') + 1));
if(!playlist)
return 0;
......
......@@ -193,9 +193,10 @@ public slots:
// Playlist slots
/**
* Create a playlist and prompt the user for a name.
* Create a playlist and prompt the user for a name if no name was
* specified.
*/
Playlist *slotCreatePlaylist();
Playlist *slotCreatePlaylist(const QString &name = QString::null);
/**
* Create a playlist from a user-defined directory, and prompt the user for
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment