Andras Mantia wrote:
> On Wednesday 22 February 2006 22:54, Christoffer Brodd-Reijer wrote:
>> Is there a KDEish way to create a folder? I have a popup menu with a
>> "New folder" action. Should I create my own dialog containing a line
>> edit and so on or can I reuse some KDE dialog?

>
> If you followed Jens' suggestion and looked at Quanta code
> (http://websvn.kde.org/brances/KDE/3....setreeview.cpp)
> you could see that we are doing the same thing there. Shortly, to have
> a dialog we use:
>
> bool ok;
> QString folderName = KInputDialog::getText(i18n("Create New Folder"),
> i18n("Folder name:"), "", &ok, this);
> if (ok)
> {
> KURL url = currentURL();
> if (currentKFileTreeViewItem()->isDir())
> url.setPath(url.path() + "/" + folderName + "/");
> else
> url.setPath(url.directory() + "/" + folderName +"/");
> QuantaNetAccess::mkdir(url, this, -1);
> }
>
> Replace QuantaNetAccess:: with KNetAccess or some other code (if you
> want recursive directory creation, see kdewebdev/libs/qextfileinfo.*
> for an example). currentURL() is the URL of the current item in the
> listview.
>
> Andras


Thank you. The basetreeview was a bit too heavy for me but I understand
what you mean and that QuantaNetAccess (or KNetAccess) is new to me, and
it seems interesting.

Thank you for point it out to me.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<