<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>71321</bug_id>
          
          <creation_ts>2003-12-27 20:02:43 +0000</creation_ts>
          <short_desc>Renaming a contact should work like renaming a group</short_desc>
          <delta_ts>2004-02-12 18:45:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kopete</product>
          <component>Main Application</component>
          <version>unspecified</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Casey Allen Shobe">cshobe</reporter>
          <assigned_to name="Kopete Developers">kopete-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>189193</commentid>
    <comment_count>0</comment_count>
    <who name="Casey Allen Shobe">cshobe</who>
    <bug_when>2003-12-27 20:02:43 +0000</bug_when>
    <thetext>Version:            (using KDE Devel)
Installed from:    Compiled sources

Renaming a group brings up a nice window prompting for the new name.  Works well and I have no complaints.

Renaming a contact tries to rename it inline.  This is currently broken in CVS in the sense that Enter does not save the change but opens a single-shot chatwindow (opposite of setting) with weird colors.  Clicking on some other area of the window does cause the change to be saved.  Also, with a focus-follows mouse setting, it&apos;s nearly unusable.  Because generally one keeps the contact list at a narrow width, they must move the mouse outside of the window (or it is condusive to do so, if not a requirement) to select the Rename option from the RMB menu.  But when the option is clicked, the window immediately loses focus, and so the action is cancelled before you can make a change.

These two renaming functions need to be consistant.  I vote strongly for the former method.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>189204</commentid>
    <comment_count>1</comment_count>
    <who name="Olivier Goffart">ogoffart</who>
    <bug_when>2003-12-27 21:32:40 +0000</bug_when>
    <thetext>Then i think both two should act like renaming a contact  
(but correctly of course)

Even, i think we shouldn&apos;t hack AT ALL this, to allow the user to rename contact like they rename a file in konqueror.
If i remember correctly, Duncan didn&apos;t like this way, that&apos;s why it is not the case anymore  (the fact that clicking on a item which already have the focus make the rename action start)   But i think KListView has been fixed since that.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>189330</commentid>
    <comment_count>2</comment_count>
    <who name="Martijn Klingens">klingens</who>
    <bug_when>2003-12-28 14:04:03 +0000</bug_when>
    <thetext>Subject: Re: [Kopete-devel]  Renaming a contact should work like renaming a group

On Saturday 27 December 2003 21:32, Olivier Goffart wrote:
&gt; Then i think both two should act like renaming a contact
&gt; (but correctly of course)

Yes, me too.

Casey, when I fixed some bugs in the inline renaming I made the code mostly 
equivalent to what Konqueror does. Doesn&apos;t the same bug occur there too?

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>189417</commentid>
    <comment_count>3</comment_count>
    <who name="Casey Allen Shobe">cshobe</who>
    <bug_when>2003-12-28 19:30:59 +0000</bug_when>
    <thetext>Olivier,

Konqueror works fine.
#1, I can press enter and the rename is saved.
#2, I can defocus and refocus the window, and Konqueror is still awaiting my renaming.

If Kopete works the same as Konqueror without the bugs, that&apos;s a fine solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205008</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Smith">kde</who>
    <bug_when>2004-02-12 14:31:27 +0000</bug_when>
    <thetext>The inline renaming works fine for me with recent KDE CVS and Kopete HEAD. Would anyone object to the group rename being switched to an inline rename?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205035</commentid>
    <comment_count>5</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-02-12 15:55:31 +0000</bug_when>
    <thetext>no, please switch it if you have time. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205087</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Smith">kde</who>
    <bug_when>2004-02-12 18:40:02 +0000</bug_when>
    <thetext>Working on it...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205088</commentid>
    <comment_count>7</comment_count>
    <who name="Richard Smith">kde</who>
    <bug_when>2004-02-12 18:42:03 +0000</bug_when>
    <thetext>CVS commit by lilachaze: 

Rename groups inline. Need to undo a string change before I can backport...
CCMAIL: 71321@bugs.kde.org


  M +4 -20     kopetecontactlistview.cpp   1.72
  M +5 -3      kopetegroupviewitem.cpp   1.15


--- kdenetwork/kopete/kopete/contactlist/kopetecontactlistview.cpp  #1.71:1.72
@@ -1461,5 +1461,5 @@ void KopeteContactListView::updateAction
         else if(groups.count() == 1 &amp;&amp; contacts.isEmpty())
         {
-                actionRename-&gt;setText(i18n(&quot;Rename Group...&quot;));
+                actionRename-&gt;setText(i18n(&quot;Rename Group&quot;));
                 actionRemove-&gt;setText(i18n(&quot;Remove Group&quot;));
                 actionRename-&gt;setEnabled(true);
@@ -1669,30 +1669,14 @@ void KopeteContactListView::slotRemove()
 void KopeteContactListView::slotRename()
 {
-        KopeteMetaContactLVI *metaLVI = dynamic_cast&lt;KopeteMetaContactLVI *&gt;( currentItem() );
-        if ( metaLVI )
+        if ( KopeteMetaContactLVI *metaLVI = dynamic_cast&lt;KopeteMetaContactLVI *&gt;( currentItem() ) )
         {
                 metaLVI-&gt;slotRename();
         }
-        else if ( KopeteContactList::contactList()-&gt;selectedGroups().count() == 1 )
+        else if ( KopeteGroupViewItem *groupLVI = dynamic_cast&lt;KopeteGroupViewItem *&gt;( currentItem() ) )
         {
-                // Not a meta contact, so rename the group instead
-                // FIXME: Shouldn&apos;t this be moved to a method KopeteGroupLVI::rename()? - Martijn
                 if ( !KopetePrefs::prefs()-&gt;sortByGroup() )
                         return;
 
-                KopeteGroup *group = KopeteContactList::contactList()-&gt;selectedGroups().first();
-
-                bool ok;
-#if KDE_IS_VERSION( 3, 1, 90 )
-                QString newname = KInputDialog::getText
-#else
-                QString newname = KLineEditDlg::getText
-#endif
-                        ( i18n( &quot;Rename Group&quot; ), i18n( &quot;Please enter the new name for group &apos;%1&apos;:&quot; ).arg( group-&gt;displayName() ),
-                        group-&gt;displayName(), &amp;ok );
-
-                if ( !ok )
-                        return;
-                group-&gt;setDisplayName( newname );
+                groupLVI-&gt;startRename( 0 );
         }
 }

--- kdenetwork/kopete/kopete/contactlist/kopetegroupviewitem.cpp  #1.14:1.15
@@ -99,6 +99,6 @@ void KopeteGroupViewItem::refreshDisplay
         }
 
-        newText += &quot; (&quot; + QString::number( onlineMemberCount ) + &quot;/&quot; + QString::number( totalMemberCount ) + &quot;)&quot;;
         m_renameText = newText;
+        newText += &quot; (&quot; + QString::number( onlineMemberCount ) + &quot;/&quot; + QString::number( totalMemberCount ) + &quot;)&quot;;
         //kdDebug( 14000 ) &lt;&lt; k_funcinfo &lt;&lt; &quot;newText=&apos;&quot; &lt;&lt; newText &lt;&lt; &quot;&apos;, old text= &quot; &lt;&lt; text( 0 ) &lt;&lt; endl;
 
@@ -128,7 +128,9 @@ void KopeteGroupViewItem::startRename( i
 {
         kdDebug(14000) &lt;&lt; k_funcinfo &lt;&lt; endl;
+        if ( col != 0 ) return;
         refreshDisplayName();
         setText( 0, m_renameText );
-        QListViewItem::startRename(col);
+        setRenameEnabled( 0, true );
+        QListViewItem::startRename( 0 );
 }
 


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205089</commentid>
    <comment_count>8</comment_count>
    <who name="Richard Smith">kde</who>
    <bug_when>2004-02-12 18:45:44 +0000</bug_when>
    <thetext>CVS commit by lilachaze: 

Rename groups inline.
CCMAIL: 71321-done@bugs.kde.org


  M +3 -19     kopetecontactlistview.cpp   1.63.2.2
  M +5 -3      kopetegroupviewitem.cpp   1.13.2.1


--- kdenetwork/kopete/kopete/contactlist/kopetecontactlistview.cpp  #1.63.2.1:1.63.2.2
@@ -1623,30 +1623,14 @@ void KopeteContactListView::slotRemove()
 void KopeteContactListView::slotRename()
 {
-        KopeteMetaContactLVI *metaLVI = dynamic_cast&lt;KopeteMetaContactLVI *&gt;( currentItem() );
-        if ( metaLVI )
+        if ( KopeteMetaContactLVI *metaLVI = dynamic_cast&lt;KopeteMetaContactLVI *&gt;( currentItem() ) )
         {
                 metaLVI-&gt;slotRename();
         }
-        else if ( KopeteContactList::contactList()-&gt;selectedGroups().count() == 1 )
+        else if ( KopeteGroupViewItem *groupLVI = dynamic_cast&lt;KopeteGroupViewItem *&gt;( currentItem() ) )
         {
-                // Not a meta contact, so rename the group instead
-                // FIXME: Shouldn&apos;t this be moved to a method KopeteGroupLVI::rename()? - Martijn
                 if ( !KopetePrefs::prefs()-&gt;sortByGroup() )
                         return;
 
-                KopeteGroup *group = KopeteContactList::contactList()-&gt;selectedGroups().first();
-
-                bool ok;
-#if KDE_IS_VERSION( 3, 1, 90 )
-                QString newname = KInputDialog::getText
-#else
-                QString newname = KLineEditDlg::getText
-#endif
-                        ( i18n( &quot;Rename Group&quot; ), i18n( &quot;Please enter the new name for group &apos;%1&apos;:&quot; ).arg( group-&gt;displayName() ),
-                        group-&gt;displayName(), &amp;ok );
-
-                if ( !ok )
-                        return;
-                group-&gt;setDisplayName( newname );
+                groupLVI-&gt;startRename( 0 );
         }
 }

--- kdenetwork/kopete/kopete/contactlist/kopetegroupviewitem.cpp  #1.13:1.13.2.1
@@ -99,6 +99,6 @@ void KopeteGroupViewItem::refreshDisplay
         }
 
-        newText += &quot; (&quot; + QString::number( onlineMemberCount ) + &quot;/&quot; + QString::number( totalMemberCount ) + &quot;)&quot;;
         m_renameText = newText;
+        newText += &quot; (&quot; + QString::number( onlineMemberCount ) + &quot;/&quot; + QString::number( totalMemberCount ) + &quot;)&quot;;
         //kdDebug( 14000 ) &lt;&lt; k_funcinfo &lt;&lt; &quot;newText=&apos;&quot; &lt;&lt; newText &lt;&lt; &quot;&apos;, old text= &quot; &lt;&lt; text( 0 ) &lt;&lt; endl;
 
@@ -128,7 +128,9 @@ void KopeteGroupViewItem::startRename( i
 {
         kdDebug(14000) &lt;&lt; k_funcinfo &lt;&lt; endl;
+        if ( col != 0 ) return;
         refreshDisplayName();
         setText( 0, m_renameText );
-        QListViewItem::startRename(col);
+        setRenameEnabled( 0, true );
+        QListViewItem::startRename( 0 );
 }
 


</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>