mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-20 17:01:22 +00:00
Fix bug reported by Stephane <s.nicolas@videotron.ca>.
"Create New Folder", and then Cancel, was still creating the undo command, so pressing undo would delete a bookmark :( svn path=/trunk/kdebase/konqueror/keditbookmarks/; revision=82612
This commit is contained in:
parent
86ae490139
commit
27d33c95b5
|
@ -101,8 +101,8 @@ void CreateCommand::execute()
|
|||
else
|
||||
if (m_group)
|
||||
{
|
||||
ASSERT( !m_text.isEmpty() );
|
||||
bk = parentGroup.createNewFolder( m_text );
|
||||
m_text = bk.fullText(); // remember it, we won't have to ask it again
|
||||
kdDebug() << "CreateCommand::execute " << m_group << " open : " << m_open << endl;
|
||||
bk.internalElement().setAttribute( "folded", m_open ? "no" : "yes" );
|
||||
}
|
||||
|
|
|
@ -312,8 +312,19 @@ void KEBTopLevel::slotDelete()
|
|||
|
||||
void KEBTopLevel::slotNewFolder()
|
||||
{
|
||||
CreateCommand * cmd = new CreateCommand( i18n("Create Folder"), insertionAddress(), QString::null, true /*open*/ );
|
||||
m_commandHistory.addCommand( cmd );
|
||||
// EVIL HACK
|
||||
// We need to ask for the folder name before creating the command, in case of "Cancel".
|
||||
// But in message-freeze time, impossible to add i18n()s. So... we have to call the existing code :
|
||||
QDomDocument doc("xbel"); // Dummy document
|
||||
QDomElement elem = doc.createElement("xbel");
|
||||
doc.appendChild( elem );
|
||||
KBookmarkGroup grp( elem ); // Dummy group
|
||||
KBookmark bk = grp.createNewFolder( QString::null ); // Asks for the name
|
||||
if ( !bk.fullText().isEmpty() ) // Not canceled
|
||||
{
|
||||
CreateCommand * cmd = new CreateCommand( i18n("Create Folder"), insertionAddress(), bk.fullText(), true /*open*/ );
|
||||
m_commandHistory.addCommand( cmd );
|
||||
}
|
||||
}
|
||||
|
||||
void KEBTopLevel::slotInsertSeparator()
|
||||
|
|
Loading…
Reference in a new issue