[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [juk/frameworks] /: Port PlaylistCollection away from KInputDialog.
From:       Michael Pyne <mpyne () kde ! org>
Date:       2017-10-01 3:23:07
Message-ID: 20171001032307.GA9826 () midna
[Download RAW message or body]

On Sun, Oct 01, 2017 at 04:21:19AM +0200, Christoph Feck wrote:
> On 30.09.2017 23:33, Michael Pyne wrote:
> > Git commit cf75c584d7ea43325f71364e1e8192bc48dbc754 by Michael Pyne.
> > Committed on 30/09/2017 at 19:53.
> > Pushed by mpyne into branch 'frameworks'.
> >
> > Port PlaylistCollection away from KInputDialog.
> >
> > M  +4    -2    playlistcollection.cpp
> >
> > https://commits.kde.org/juk/cf75c584d7ea43325f71364e1e8192bc48dbc754
> >
> > diff --git a/playlistcollection.cpp b/playlistcollection.cpp
> > index 450d4f7..73ed343 100644
> > --- a/playlistcollection.cpp
> > +++ b/playlistcollection.cpp
> > @@ -19,7 +19,6 @@
> >
> >  #include <kurl.h>
> >  #include <kiconloader.h>
> > -#include <kinputdialog.h>
> >  #include <kmessagebox.h>
> >  #include <kfiledialog.h>
> >  #include <kactioncollection.h>
> > @@ -36,6 +35,7 @@
> >  #include <QMutableListIterator>
> >  #include <QObject>
> >  #include <QPixmap>
> > +#include <QInputDialog>
> >  #include <QStackedWidget>
> >
> >  #include <sys/types.h>
> > @@ -774,9 +774,11 @@ QString PlaylistCollection::playlistNameDialog(const QString &caption,
> >  {
> >      bool ok;
> >
> > -    QString name = KInputDialog::getText(
> > +    QString name = QInputDialog::getText(
> > +        m_playlistStack,
> >          caption,
> >          i18n("Please enter a name for this playlist:"),
> > +        QLineEdit::Normal,
> >          forceUnique ? uniquePlaylistName(suggest) : suggest,
> >          &ok);
> >
> >
> 
> Nice porting work, Michael! Please read KInputDialog notice on 
> https://community.kde.org/Frameworks/Porting_Notes for an important 
> difference between KInputDialog and QInputDialog.

Hi Christoph, and thanks for the tip!  In this case an empty return
value is acceptable (the actual check happens in the
PlaylistCollection::rename function, which already uses an isEmpty()
check to determine whether the new name is acceptable or not).  But it
is certainly a good thing to keep in mind!

Regards,
 - Michael Pyne
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic