Bug 116906

Summary: annoying spelling window positioning
Product: kbabel Reporter: Robert Gomułka <robertg.123>
Component: generalAssignee: Stanislav Visnovsky <visnovsky>
Status: RESOLVED FIXED    
Severity: normal CC: ana, nicolasg, nive
Priority: NOR    
Version: 1.10.2   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Bug occurence
patch to remove automatic positionning

Description Robert Gomułka 2005-11-22 21:21:45 UTC
Version:           1.10.2 (using KDE KDE 3.4.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

When one opens spellchecker in kbabel (ctrl-i) (tools->spelling->check spelling), the dialog box appears always in the same place (left side of the screen) covering the most important part of the application (msgid and msgstr). Moreover, after moving it and going to next spelling error (via ignore, correct or other) this dialog box goes back to previous position. Changing its size works, but the position is always the same.
Expected behaviour - this dialog box should remember its position.
This bug can be very annoying for KDE translators.
Comment 1 Robert Gomułka 2005-11-22 21:24:18 UTC
Created attachment 13600 [details]
Bug occurence

The dialog box is always in the same position.
Comment 2 Robert Gomułka 2005-12-27 16:22:17 UTC
I am not KDE/QT programmer, but I have searched through kbabel sources and found nothing wrong.
I have also compared code with kate spelling (which works correctly) and found that kbabel uses KSpell::checkList(), while Kate uses KSpell::check().
I have also performed an experiment and replaced in kbabelview.cpp:
	//spell.kspell->checkList(&spell.wordList);
	spell.kspell->check(spell.wordList.join(" "));
and found, that spellchecker dialog is positioned ok (and remembers its position). Yes, I know this piece of code is wrong, I did it only for testing purposes.
After that and a quick look into kspell code I guess that something is wrong with KSpell::checkList() method.
Comment 3 Robert Gomułka 2006-01-16 19:11:45 UTC
Still exists on KDE 3.5.
Comment 4 Olivier Trichet 2006-04-22 23:18:57 UTC
The problem comes from the kbabel's code itself, the spellchecker position is force to a "fixe" position. The following code should be remove since it does the contrary of what the comment says.
Thanks.

--- KDE/kdesdk/kbabel/kbabel/kbabelview.cpp     (révision 532798)
+++ KDE/kdesdk/kbabel/kbabel/kbabelview.cpp     (copie de travail)
@@ -4190,15 +4190,6 @@
                                "the problem) by using Help->Report Bug..."));
        }

-        // Move dialog out of the way of the msgstr
-       if(textOk)
-       {
-           // remap to the top of the main window (parent of this)
-           int posY = mapFromGlobal(
-               msgstrEdit->mapToGlobal( QPoint(0,0) ) ).y()-spell.kspell->heightDlg();
-           spell.kspell->moveDlg(width()-spell.kspell->widthDlg(), posY-10);
-       }
-
        return textOk;
 }
Comment 5 Mark Ziegler 2006-06-21 19:34:29 UTC
It is still there.

SuSE 9.3, KDE 3.5.3
Comment 6 Robert Gomułka 2006-06-21 20:17:15 UTC
Actually no changes were made to kbabelview.cpp in Subversion - it is still 3 months old (from March).
Comment 7 Nicolas Goutte 2006-06-24 13:27:07 UTC
To comment #4: could you attach the patch to the bug report, please? (As the patch was not attached, it is corrupted and difficult to extract for use.)
Comment 8 Olivier Trichet 2006-06-24 14:01:47 UTC
Created attachment 16776 [details]
patch to remove automatic positionning
Comment 9 Nicolas Goutte 2006-06-24 14:47:20 UTC
SVN commit 554567 by goutte:

Do not try to be smarter than the KSpell dialog on where it should be created.
BUG:116906
(Foreward port of revision 554565; might not compile.)
(Sorry for the wrong bug number for the revision 554565.)


 M  +0 -9      kbabelview.cpp  


--- trunk/KDE/kdesdk/kbabel/kbabel/kbabelview.cpp #554566:554567
@@ -4190,15 +4190,6 @@
 				"the problem) by using Help->Report Bug..."));
 	}
 
-        // Move dialog out of the way of the msgstr
-	if(textOk)
-	{
-	    // remap to the top of the main window (parent of this)
-	    int posY = mapFromGlobal(
-		msgstrEdit->mapToGlobal( QPoint(0,0) ) ).y()-spell.kspell->heightDlg();
-	    spell.kspell->moveDlg(width()-spell.kspell->widthDlg(), posY-10);
-	}
-
 	return textOk;
 }