Bug 140189 - Can't compile because of protected method
Summary: Can't compile because of protected method
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-17 13:59 UTC by Jiri Klement
Modified: 2007-08-02 11:36 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 Jiri Klement 2007-01-17 13:59:55 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 4.1.1-r3 
OS:                Linux

I can't compile current okular version (from svn).

Error:
/var/tmp/portage/okular-0.5_p9999/work/graphics/okular/core/generator.h: In memb
er function 'void Okular::Document::Private::sendGeneratorRequest()':
/var/tmp/portage/okular-0.5_p9999/work/graphics/okular/core/generator.h:425: err
or: 'void Okular::PixmapRequest::swap()' is protected
/var/tmp/portage/okular-0.5_p9999/work/graphics/okular/core/document.cpp:556: er
ror: within this context
make[2]: *** [okular/CMakeFiles/okularcore.dir/core/document.o] Error 1

When I change function Okular::PixmapRequest::swap() to be public, then okular compiles (and works) fine.
Comment 1 Pino Toscano 2007-01-17 15:19:39 UTC
Okular::PixmapRequest::swap() must not be public.
Comment 2 Pino Toscano 2007-01-17 15:20:11 UTC
SVN commit 624631 by pino:

A bit ugly hack to make it compile better.

BUG: 140189

Tobias, any better solution than the previous situation?
CCMAIL: tokoe@kde.org


 M  +9 -1      document.cpp  
 M  +3 -0      document.h  


--- trunk/playground/graphics/okular/core/document.cpp #624630:624631
@@ -553,7 +553,7 @@
         m_pixmapRequestsStack.removeAll ( request );
 
         if ( (int)m_rotation % 2 )
-            request->swap();
+            m_parent->doSwap( request );
 
         m_generator->generatePixmap ( request );
     }
@@ -2135,6 +2135,14 @@
     kDebug() << "PageSize no: " << newsize << endl;
 }
 
+void Document::doSwap( PixmapRequest * pm )
+{
+    if ( !pm )
+        return;
+
+    pm->swap();
+}
+
 /** DocumentViewport **/
 
 DocumentViewport::DocumentViewport( int n )
--- trunk/playground/graphics/okular/core/document.h #624630:624631
@@ -528,6 +528,7 @@
     private:
         class Private;
         Private* const d;
+        friend class Private;
 
         Q_DISABLE_COPY( Document )
 
@@ -535,6 +536,8 @@
         Q_PRIVATE_SLOT( d, void slotTimedMemoryCheck() )
         Q_PRIVATE_SLOT( d, void sendGeneratorRequest() )
         Q_PRIVATE_SLOT( d, void rotationFinished( int page ) )
+
+        void doSwap( PixmapRequest * );
 };