Blob Blame History Raw
commit bb773366167af50fc99025473dc20ab5ab41e1cc
Author: Sergio Martins <iamsergio@gmail.com>
Date:   Wed Aug 15 13:01:48 2012 +0100

    Make KTimeTracker start.
    
    By using a dynamic_cast<> instead of a qobject_cast<>.
    
    A proper fix would be fixing the CMakeLists.txt file:
    
    ktimetrackerpart.cpp is defined twice, one in the ktimetracker
    binary, and one in the plugin, this will make qobject_cast fail
    somewhere in KPluginLoaded/KPluginFactory code.
    
    I tried fixing CMakeLists.txt but it's not trivial, there's
    a interdependency between stuff and couldn't get it to work with
    the little time I have for it.
    
    CCBUG: 285434
    BUG: 283479
    BUG: 291258

diff --git a/ktimetracker/mainwindow.cpp b/ktimetracker/mainwindow.cpp
index 1fcc98a..67e5c9f 100644
--- a/ktimetracker/mainwindow.cpp
+++ b/ktimetracker/mainwindow.cpp
@@ -65,7 +65,7 @@ MainWindow::MainWindow( const QString &icsfile )
     {
         // now that the Part is loaded, we cast it to a Part to get
         // our hands on it
-        m_part = factory->create<ktimetrackerpart>( this );
+        m_part = dynamic_cast<ktimetrackerpart*>( factory->create<KParts::ReadWritePart>( this ) );
 
         if (m_part)
         {