Bug 227072 - Patch to change tab title in KRDC
Summary: Patch to change tab title in KRDC
Status: RESOLVED DUPLICATE of bug 203310
Alias: None
Product: krdc
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Urs Wolfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-15 21:10 UTC by Kevin Gilbert
Modified: 2010-06-20 21:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Patch for getting names in tabs instead of url (4.86 KB, patch)
2010-02-23 11:18 UTC, deadeyes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Gilbert 2010-02-15 21:10:08 UTC
Version:           4.3.5 (using KDE 4.3.5)
OS:                Linux
Installed from:    Fedora RPMs

Using the URL for the title of the tab in KRDC is a little annoying. What I would like to see is either
the name from the bookmark entry, if appropriate, or
just the first element of the URL (after the '@' character).

I don't have the time to implement (1) but the following path achieves (2).

diff -up kdenetwork-4.3.4/krdc/mainwindow.cpp ~/mainwindow.cpp
--- kdenetwork-4.3.4/krdc/mainwindow.cpp        2009-11-28 00:03:39.000000000 +1100
+++ /home/kmg/mainwindow.cpp    2010-02-08 08:13:19.000000000 +1100
@@ -396,7 +396,11 @@ void MainWindow::newConnection(const KUr

     QScrollArea *scrollArea = createScrollArea(m_tabWidget, view);

-    const int newIndex = m_tabWidget->addTab(scrollArea, KIcon("krdc"), url.prettyUrl(KUrl::RemoveTrailingSlash));
+       QString originalTitle = url.prettyUrl( KUrl::RemoveTrailingSlash );
+       int at = originalTitle.indexOf( '@' ) + 1;
+       QString newTitle = originalTitle.mid( at, originalTitle.indexOf( '.', at ) - at );
+
+    const int newIndex = m_tabWidget->addTab(scrollArea, KIcon("krdc"), newTitle );
     m_tabWidget->setCurrentIndex(newIndex);
     tabChanged(newIndex); // force to update m_currentRemoteView (tabChanged is not emitted when start page has been disabled)
Comment 1 Pavel Baranchikov 2010-02-17 06:09:52 UTC
I think it is a duplicate of bug 203310
Comment 2 Urs Wolfer 2010-02-18 21:05:55 UTC
I think your patch is not enough... It just simplifies the url, but does not respect the bookmarks title for example.

Thanks for your report.

*** This bug has been marked as a duplicate of bug 203310 ***
Comment 3 Kevin Gilbert 2010-02-18 21:12:45 UTC
I agree but like I said "I don't have the time to implement (1) but the following path achieves (2)".
Comment 4 deadeyes 2010-02-23 11:18:34 UTC
Created attachment 41030 [details]
Patch for getting names in tabs instead of url
Comment 5 deadeyes 2010-02-23 11:18:53 UTC
I have fixed your first wish.
With the patch applied you will see the name as stated in the bookmark editor.
THis is actually a easy fix (and I do not have programming experience in this language, only some in Java).

I hope this makes you all happy.
I wrote this patch more then 2 months ago and thought it would be fixed by now.
But it still isn't so that is why I post it :)
Comment 6 deadeyes 2010-06-20 20:23:30 UTC
Has this been merged in the main branch?
And what version can I expect this patch to be included?

I am on 4.4.4 now and still this is not included :s
Comment 7 Urs Wolfer 2010-06-20 21:45:01 UTC
This is a new feature; it will be in KDE SC 4.5.