This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[Patch/Feature Request] Unable to copy the tracker URL

Tags: None
(comma "," separated)
imported4-florian
Registered Member
Posts
3
Karma
0
Hi folks,

I am a big fan of your KTorrent application and I use it with joy. Though there was one issue that I hated: Not being able to copy the tracker URL out of lblCurrent (the field near "Tracker URL:"). This is useful to share public trackers with other people and/or other torrents. I fixed this earlier, and created a patch (as I always do when fixing something); and now I would like to contribute it back. The patch is based on KTorrent 2.2dev, which I obtained from 'make'ing net-p2p/ktorrent-devel on FreeBSD.

What does it do?
-> It changes "lblCurrent" in the infowidget plugin from a K<something> to a QLineEdit
-> Sets the QLineEdit property "readOnly" to "true".
-> Enables boldness in the font of the QLineEdit.
-> Changes the code, so the QLineEdit is only updated when the tracker changed. This is necessary otherwise the user doesn't have the time to select the URL.

There you go:

Code: Select all
diff -Naur infowidgetold/trackerview.cpp infowidget/trackerview.cpp
--- infowidgetold/trackerview.cpp   Thu Oct  4 15:00:12 2007
+++ infowidget/trackerview.cpp   Thu Oct  4 15:02:59 2007
@@ -165,7 +165,11 @@
 
       lblStatus->setText("<b>" + s.trackerstatus + "</b>");
       if (tc->getTrackersList())
-         lblCurrent->setText("<b>" + tc->getTrackersList()->getTrackerURL().prettyURL() + "</b>");
+      {
+         QString t = tc->getTrackersList()->getTrackerURL().prettyURL();
+         if (lblCurrent->text() != t )
+            lblCurrent->setText(t);
+      }
       else
          lblCurrent->clear();
       
diff -Naur infowidgetold/trackerviewbase.ui infowidget/trackerviewbase.ui
--- infowidgetold/trackerviewbase.ui   Thu Oct  4 15:00:12 2007
+++ infowidget/trackerviewbase.ui   Thu Oct  4 15:01:34 2007
@@ -56,9 +56,17 @@
                                 <string>Tracker URL:</string>
                             </property>
                         </widget>
-                        <widget class="KSqueezedTextLabel">
+                        <widget class="QLineEdit">
                             <property name="name">
                                 <cstring>lblCurrent</cstring>
+                            </property>
+                            <property name="readOnly">
+                                <bool>true</bool>
+                            </property>
+                            <property name="font">
+                                <font>
+                                    <bold>1</bold>
+                                </font>
                             </property>
                             <property name="sizePolicy">
                                 <sizepolicy>


Regards,
Florian Stinglmayr
George
Moderator
Posts
5421
Karma
1

Fri Oct 05, 2007 11:31 am
Can you send it to me in a file, copy pasting patches from the forum usually ends up in stuff which doesn't want to apply.
imported4-florian
Registered Member
Posts
3
Karma
0

Fri Oct 05, 2007 3:59 pm
As you wish... ;)
George
Moderator
Posts
5421
Karma
1

Tue Oct 09, 2007 6:37 pm
I haven't seen one in my mailbox.

Btw, in the KDE4 version it is now possible to select the url, in Qt4 it is possible to make the text of a QLabel selectable.
imported4-florian
Registered Member
Posts
3
Karma
0

Sat Oct 13, 2007 7:03 am
George wrote:I haven't seen one in my mailbox.


Are you sure it didn't end up in junk? Anyway I will resend it.


FreeBSD - The power to serve!
George
Moderator
Posts
5421
Karma
1

Sun Oct 14, 2007 4:44 pm
I think I found your second e-mail in my spam folder.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell