KURLRequesterDlg::getURL

Reinhold Kainhofer reinhold at kainhofer.com
Wed Jun 8 13:45:15 BST 2005


Can we add an additional (static) getURL method to KURLRequesterDlg that also 
allows us to use a custom label text?
Here's the code that I used in kdepim/libkdepim/kpimurlrequesterdlg.cpp (which 
is basically duplicated from kurlrequesterdlg.cpp), since we need this with 
kdelibs 3.4:

KURL KPimURLRequesterDlg::getURL( const QString& dir, const QString &label,
                                  QWidget *parent, const QString& caption )
{
    KURLRequesterDlg dlg(dir, label, parent, "filedialog", true);

    dlg.setCaption(caption.isNull() ? i18n("Open") : caption);

    dlg.exec();

    const KURL& url = dlg.selectedURL();
    if (url.isValid())
        KRecentDocument::add(url);

    return url;
}

Also, can we make the label in the dialog line-break if needed?

Cheers,
Reinhold
-- 
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: reinhold at kainhofer.com, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer / KPilot maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050608/91731258/attachment.sig>


More information about the kde-core-devel mailing list