[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kviewshell-0.7/kviewshell
From:       Stefan Kebekus <kebekus () kde ! org>
Date:       2006-08-17 18:45:41
Message-ID: 1155840341.643771.24993.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 573997 by kebekus:

version check when loading the kviewerpart-library


 A             TODO-Before-RELEASE  
 M  +2 -0      shell/kviewpart.h  
 M  +25 -1     shell/kviewshell.cpp  


--- branches/work/kviewshell-0.7/kviewshell/shell/kviewpart.h #573996:573997
@@ -44,6 +44,8 @@
 {
   Q_OBJECT
 
+  Q_CLASSINFO( "Version", "Version 1 for KDE 3" )
+
 public:
   KViewPart(QWidget* parentWidget, const char* widgetName, QObject* parent,
             const char* name, const QStringList& args);
--- branches/work/kviewshell-0.7/kviewshell/shell/kviewshell.cpp #573996:573997
@@ -70,10 +70,34 @@
     if (!view)
       ::exit(-1);
   } else {
-    KMessageBox::error(this, i18n("No viewing component found"));
+    KMessageBox::detailedError(this, 
+                               i18n("<qt>A fatal error ocurred. An important library \
could not be found. KViewShell will quit now.</qt>"), +                               \
i18n("<qt><p>The KViewShell application uses the <strong>kviewerpart</strong> library \
internally. " +                                    "This  library was not found on \
your computer.</p>" +                                    "<p>The problem is most \
likely a broken installation of the KViewShell application. " +                       \
"You could try to uninstall all instances of KViewShell and then re-install the \
latest version.</p></qt>"),  +                               i18n("KViewShell - \
Critical Error"));  ::exit(-1);
   }
 
+  QString version(view->metaObject()->classInfo("Version"));
+  QString expectedVersion("Version 1 for KDE 3");
+ if (version != expectedVersion) {
+    if (version.isEmpty())
+      version = "Version 0, probaby from KDE 3.4 or older";
+    KMessageBox::detailedError(this, 
+                               i18n("<qt>A fatal error ocurred. An incompatible \
version of an important library was found. KViewShell will quit now.</qt>"), +        \
i18n("<qt><p>The KViewShell application uses the <strong>kviewerpart</strong> library \
internally. " +                                    "A version of this library was \
found, but this version is <strong>not</strong> compatible with the current version " \
+                                    "of the KViewShell application.</p>" +           \
"<p>Version found: <strong>%1</strong></p>" +                                    \
"<p>Version required: <strong>%2</strong></p>" +                                    \
"<p>The problem is most likely that two incompatible versions of KViewShell are \
simultaneously installed on your computer. " +                                    \
"You could try to uninstall all instances of KViewShell and then re-install the \
latest version.</p></qt>").arg(version).arg(expectedVersion), +                       \
i18n("KViewShell - Critical Error")); +    ::exit(-1);
+  }
+
   setCentralWidget(view->widget());
 
   // file menu


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic