Bug 72494 - KBabel without file tries to edit something
Summary: KBabel without file tries to edit something
Status: RESOLVED FIXED
Alias: None
Product: kbabel
Classification: Miscellaneous
Component: KBabel editor (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Stanislav Visnovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-12 18:31 UTC by Stanislav Visnovsky
Modified: 2004-01-13 10:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Visnovsky 2004-01-12 18:31:47 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

It does not show credits at startup as it used to do.

And it crashes, because no PO file is open.
Comment 1 Stanislav Visnovsky 2004-01-13 10:24:51 UTC
Subject: kdesdk/kbabel/kbabel

CVS commit by nanulo: 

Do not try to update editor if no file is open (on language change).
After language change, restore readonly state.

CCMAIL: 72494-done@bugs.kde.org


  M +3 -1      hidingmsgedit.cpp   1.12
  M +5 -1      kbabelview2.cpp   1.68


--- kdesdk/kbabel/kbabel/hidingmsgedit.cpp  #1.11:1.12
@@ -117,9 +117,9 @@ void HidingMsgEdit::showForm(int form)
 void HidingMsgEdit::setNumberOfPlurals( uint numberOfPlurals )
 {
-  kdDebug () << "Setting plural forms number for edit:" << numberOfPlurals << endl;
   _numberOfPlurals = numberOfPlurals;
   
   // find out the current shown version
   bool plurals = _currentEdit != _singleEdit;
+  bool readonly = _currentEdit  ? _currentEdit->isReadOnly () : true;
   
   // cleanup old
@@ -169,4 +169,6 @@ void HidingMsgEdit::setNumberOfPlurals( 
   
   showPlurals( plurals );
+  
+  _currentEdit->setReadOnly (readonly);
 }
 

--- kdesdk/kbabel/kbabel/kbabelview2.cpp  #1.67:1.68
@@ -97,5 +97,9 @@ void KBabelView::setNewLanguage()
 
     msgstrEdit->setNumberOfPlurals (s.numberOfPluralForms);
+    
+    if (! _catalog->currentURL().isEmpty())
+    {
     updateEditor( form );
+    }
 }