Index: kbuildsycoca.cpp
===================================================================
RCS file: /home/kde/kdelibs/kded/kbuildsycoca.cpp,v
retrieving revision 1.112
diff -u -r1.112 kbuildsycoca.cpp
--- kbuildsycoca.cpp	16 Mar 2005 17:08:41 -0000	1.112
+++ kbuildsycoca.cpp	26 Mar 2005 13:52:01 -0000
@@ -34,6 +34,7 @@
 #include <kbuildprotocolinfofactory.h>
 #include <kctimefactory.h>
 #include <kdatastream.h>
+#include <kde_file.h>
 
 #include <qdatastream.h>
 #include <qfile.h>
@@ -58,6 +59,9 @@
 # include <kmessagebox.h>
   bool silent;
   bool showprogress;
+#ifdef Q_WS_WIN
+# include <win32_utils.h>
+#endif
 #endif
 
 #include <stdlib.h>
@@ -89,6 +93,10 @@
 static bool bGlobalDatabase = false;
 static bool bMenuTest = false;
 
+#ifdef KBUILDSYCOCA_GUI
+#define i18n QObject::tr
+#endif
+
 void crashHandler(int)
 {
    // If we crash while reading sycoca, we delete the database
@@ -544,7 +552,8 @@
     str << existingResourceDirs();
     str << g_vfolder->allDirectories(); // Extra resource dirs
 
-    // Recreate compatibility symlink
+    // Recreate compatibility symlink (TODO: remove for KDE4)
+#ifndef Q_WS_WIN //not needed for win32
     QString oldPath = oldSycocaPath();
     if (!oldPath.isEmpty())
     {
@@ -554,9 +563,10 @@
           QString tmpFile = tmp.name();
           tmp.unlink();
           symlink(QFile::encodeName(path), QFile::encodeName(tmpFile));
-          rename(QFile::encodeName(tmpFile), QFile::encodeName(oldPath));
+          KDE_rename(QFile::encodeName(tmpFile), QFile::encodeName(oldPath));
        }
     }
+#endif
   }
   return true;
 }
@@ -716,9 +726,13 @@
 
 static KCmdLineOptions options[] = {
    { "nosignal", I18N_NOOP("Do not signal applications to update"), 0 },
+#ifdef Q_WS_WIN
    { "noincremental", I18N_NOOP("Disable incremental update, re-read everything"), 0 },
+#endif
    { "checkstamps", I18N_NOOP("Check file timestamps"), 0 },
+#ifdef Q_WS_WIN
    { "nocheckfiles", I18N_NOOP("Disable checking files (dangerous)"), 0 },
+#endif
    { "global", I18N_NOOP("Create global database"), 0 },
    { "menutest", I18N_NOOP("Perform menu generation test run only"), 0 },
    { "track <menu-id>", I18N_NOOP("Track menu id for debug purposes"), 0 },
@@ -746,6 +760,7 @@
                 KAboutData::License_GPL, "(c) 1999-2002 KDE Developers");
    d.addAuthor("David Faure", I18N_NOOP("Author"), "faure@kde.org");
    d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org");
+   d.addCredit("Jarosław Staniek", I18N_NOOP("Fixes, graphical version for MS Windows"), "js@iidea.pl");
 
    KCmdLineArgs::init(argc, argv, &d);
    KCmdLineArgs::addCmdLineOptions(options);
@@ -762,6 +777,13 @@
    KApplication::disableAutoDcopRegistration();
 #ifdef KBUILDSYCOCA_GUI
    KApplication k;
+
+   //make kbuildsycoca translatable
+   QTranslator *transl = new QTranslator();
+   if (transl->load( k.instanceName() + "_" + getWin32LocaleName(), ""))
+     k.installTranslator( transl );
+   else
+     delete transl;
 #else
    KApplication k(false, false);
 #endif
@@ -821,9 +843,13 @@
    }
    fprintf(stderr, "%s running...\n", appName);
 
+#ifdef Q_WS_WIN //incremental seems to be unsafe on win32
+   bool checkfiles = true;
+   bool incremental = false;
+#else
    bool checkfiles = bGlobalDatabase || args->isSet("checkfiles");
-
    bool incremental = !bGlobalDatabase && args->isSet("incremental") && checkfiles;
+#endif
    if (incremental || !checkfiles)
    {
      KSycoca::self()->disableAutoRebuild(); // Prevent deadlock
