Bug 128939 - missing file kbabel.defaultproject inhibits the user from updating the identity
Summary: missing file kbabel.defaultproject inhibits the user from updating the identity
Status: RESOLVED FIXED
Alias: None
Product: kbabel
Classification: Miscellaneous
Component: general (show other bugs)
Version: 1.11.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Stanislav Visnovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-10 12:30 UTC by Thomas Reitelbach
Modified: 2006-11-20 18:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Try to fix the dialog for a missing default project (2.63 KB, patch)
2006-06-24 22:26 UTC, Nicolas Goutte
Details
Fix project handling when default project is missing (16.32 KB, patch)
2006-11-18 17:33 UTC, Stephan Johach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Reitelbach 2006-06-10 12:30:19 UTC
Version:           1.11.2 (using KDE 3.5.2, compiled sources)
Compiler:          gcc version 3.4.1
OS:                Linux (i686) release 2.6.15.4

I wanted to remove my KBabel configuration and restart with a fresh one.
For this reason i removed all files related to kbabel under ~/.kde/share/config and ~/.kde/share/apps.

On next start of kbabel it asks me to input my identity on first startup, but all fields are gray and disabled.
I found the reason is, that the file kbabel.defaultproject was missing and kbabel did not recreate a standard-version of the file on startup. This prevents me from updating my user details.
Comment 1 Nicolas Goutte 2006-06-24 19:59:04 UTC
I can confirm.

It is enough to rename the kbabel.defaultproject file to get that bug (even if in that case, you do not get the dialog at startup, but you cannot change the project setting).

Have a nice day!
Comment 2 Nicolas Goutte 2006-06-24 20:29:25 UTC
SVN commit 554679 by goutte:

Allow to open empty files as KBabel project files
CCBUG:128939
(That is not exactly the same bug, but it has the same symptom.)


 M  +12 -1     kbproject.cpp  


--- branches/KDE/3.5/kdesdk/kbabel/common/kbproject.cpp #554678:554679
@@ -66,8 +66,19 @@
 	// first, for existing file check the MIME type
 	// it has to be text file
 	KMimeType::Ptr mime = KMimeType::findByURL( KURL::fromPathOrURL( file ) );
-	if( mime->name() != "text/plain" )
+        
+	if ( mime->name() == "text/plain" )
+        {
+            // Plain text, no problem! 
+        }
+        else if ( mime->name() == "application/x-zerosize" )
+        {
+            // Empty files are allowed too
+            kdWarning() << "Empty KBabel project file!" << endl;
+        }
+        else
 	{
+            // Unknown mime type, abort!
             // ### TODO: should the user not be asked instead?
 	    kdWarning () << "File type is " << mime->name() << endl;
 	    return;
Comment 3 Nicolas Goutte 2006-06-24 22:26:02 UTC
Created attachment 16779 [details]
Try to fix the dialog for a missing default project

The patch does not work, as the project configuration dialog show gray entries.
Comment 4 Stephan Johach 2006-11-18 17:33:52 UTC
Created attachment 18605 [details]
Fix project handling when default project is missing

Please try the appended patch. It should fix all problems related to a missing
default project file.
Comment 5 Thomas Reitelbach 2006-11-19 19:53:36 UTC
I can confirm that the bug is fixed by the patch provided by Stephan Johach. I'd like to see the fix in SVN :)

Thanks :)
Comment 6 Stephan Johach 2006-11-20 18:29:49 UTC
SVN commit 606520 by johach:

Fix problems when no default project is found.
KBabel used a KDE function which returns a null string
if the requested file does not exist. That lead to
some strange problems with disabled project configuration
settings.
BUG:128939


 M  +12 -8     catalogmanager/catalogmanager.cpp  
 M  +2 -1      catalogmanager/catalogmanager.h  
 M  +3 -1      catalogmanager/main.cpp  
 M  +3 -0      common/catalog.cpp  
 M  +1 -3      common/catalog.h  
 M  +1 -0      common/catalogitem.cpp  
 M  +4 -1      common/kbproject.cpp  
 M  +9 -0      common/kbprojectmanager.cpp  
 M  +2 -0      common/kbprojectmanager.h  
 M  +0 -1      common/resources.h  
 M  +1 -0      kbabel/hidingmsgedit.cpp  
 M  +18 -13    kbabel/kbabel.cpp  
 M  +2 -2      kbabel/kbabel.h  
 M  +12 -9     kbabel/main.cpp  
 M  +1 -1      kbabel/mymultilineedit.cpp