[Kget] Paste from clipboard - multiple links

Lukas Appelhans l.appelhans at gmx.de
Tue Mar 18 06:40:18 CET 2008


Am Montag, 17. März 2008 12:24:22 schrieb Kolik Software:
> Hello, I was wondering whether there would be any support to pasting
> multiple links from clipboard, such as:
>
> http://www.somelink.xx/file.rar1
> http://www.somelink.xx/file.rar2
> http://www.somelink.xx/file.rar3
>
> At some forums, such multiple links are listed in plain text targeting
> a big file split into multiple rars. In such cases, I would have to
> select each by one and copy to KGet. I was hoping that in a new Kde4
> KGet this would be supported, but it wasn't. Even it didn't support
> importing text files.
Yo that's on my todo-list already :D anyway my todo-list is pretty long :D
>
> As I have never found this to be listed on some todo list, I made it
> myself, however, it would be nice to have it in an official branch and
> also to extend the idea (e.g. I would appreciate having a "Copy from
> clipboard" button in a KGet's systray popup menu instead of having
> Auto Paste mode selected which causes problems when I copy urls I
> don't want to download - links to a blog, for example).
Yo true, I'm not a fan of autopaste mode too ;) :D
>
> I'm new here and in Linux, so I don't know your development processes.
> So I'm gonna paste my code here, just for inspiration and hope some of
> you gurus will do something about it.
Hehe we're not gurus ;) :D
>
> I apologize if this has been discussed before already.
>
> This is how I modified a "slotCheckClipboard" method in
> mainwindow.cpp. It would though need some more error checking.
>
> void MainWindow::slotCheckClipboard()
> {
>     QString clipData =
> QApplication::clipboard()->text(QClipboard::Clipboard).trimmed();
>
>     if (clipData != lastClipboard)
>     {
>         lastClipboard = clipData;
>         if (lastClipboard.isEmpty())
>             return;
>
> 	QStringList list = lastClipboard.split(QRegExp("[\r\n]"));
> 	KUrl::List urlList = KUrl::List(list);
> 	KGet::addTransfer(urlList);
>     }
> }
Hey thanks for your mail =)
We have clipboard support in NewTransferDialog, so that's the proper place for 
it....
We should simply check if there are more than one url in the clipboard and if 
so make it using a QListWidget using setMultiple(true)...

Regards

Lukas
>
> Regards,
> Kolik
> _______________________________________________
> Kget mailing list
> Kget at kde.org
> https://mail.kde.org/mailman/listinfo/kget




More information about the Kget mailing list