--===============1885805492==
Content-Type: multipart/signed;
boundary="nextPart3322381.XNSHS7UucP";
protocol="application/pgp-signature";
micalg=pgp-sha1
Content-Transfer-Encoding: 7bit

--nextPart3322381.XNSHS7UucP
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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=20
(http://websvn.kde.org/brances/KDE/3....ws/basetreevi=
ew.cpp)=20
you could see that we are doing the same thing there. Shortly, to have=20
a dialog we use:

bool ok;
QString folderName =3D KInputDialog::getText(i18n("Create New Folder"),=20
i18n("Folder name:"), "", &ok, this);
if (ok)
{
KURL url =3D 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=20
want recursive directory creation, see kdewebdev/libs/qextfileinfo.*=20
for an example). currentURL() is the URL of the current item in the=20
listview.

Andras

=2D-=20
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org

--nextPart3322381.XNSHS7UucP
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBD/YjTTQdfac6L/08RAulTAKDI4tXATZZaO/TNsaKv/N+0DYLudQCfRcCr
YWCf2UddYAoLuBD/foiSPFE=
=qo6V
-----END PGP SIGNATURE-----

--nextPart3322381.XNSHS7UucP--

--===============1885805492==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


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


--===============1885805492==--