OSDN Git Service

gwenview: drop OpenGL support
authorIvailo Monev <xakepa10@gmail.com>
Wed, 17 Feb 2021 01:44:19 +0000 (03:44 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 17 Feb 2021 01:44:19 +0000 (03:44 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
gwenview/app/configdialog.cpp
gwenview/app/imageviewconfigpage.ui
gwenview/lib/CMakeLists.txt
gwenview/lib/documentview/documentview.h
gwenview/lib/documentview/documentviewcontainer.cpp
gwenview/lib/documentview/documentviewcontainer.h
gwenview/lib/gwenviewconfig.kcfg

index eb4f9ad..b62bd4d 100644 (file)
@@ -87,10 +87,6 @@ ConfigDialog::ConfigDialog(QWidget* parent)
 
     d->mAnimationMethodGroup = new InvisibleButtonGroup(widget);
     d->mAnimationMethodGroup->setObjectName(QLatin1String("kcfg_AnimationMethod"));
-    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.glAnimationRadioButton, int(DocumentView::GLAnimation));
-#ifndef HAVE_OPENGL
-    d->mImageViewConfigPage.glAnimationRadioButton->setVisible(false);
-#endif
     d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.softwareAnimationRadioButton, int(DocumentView::SoftwareAnimation));
     d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.noAnimationRadioButton, int(DocumentView::NoAnimation));
 
index f5e1e5a..f7c193a 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>400</width>
-    <height>385</height>
+    <height>392</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout">
      <property name="alignment">
       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
      </property>
-     <property name="buddy">
-      <cstring>glAnimationRadioButton</cstring>
-     </property>
     </widget>
    </item>
-   <item row="8" column="1">
-    <layout class="QHBoxLayout" name="horizontalLayout_9">
-     <item>
-      <widget class="QRadioButton" name="glAnimationRadioButton">
-       <property name="text">
-        <string>OpenGL</string>
-       </property>
-       <property name="checked">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_7">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item row="9" column="1">
-    <layout class="QHBoxLayout" name="horizontalLayout_8">
-     <item>
-      <widget class="QRadioButton" name="softwareAnimationRadioButton">
-       <property name="text">
-        <string>Software</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_8">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
    <item row="10" column="1">
     <layout class="QHBoxLayout" name="horizontalLayout_7">
      <item>
      </property>
     </spacer>
    </item>
+   <item row="8" column="1">
+    <layout class="QHBoxLayout" name="horizontalLayout_8">
+     <item>
+      <widget class="QRadioButton" name="softwareAnimationRadioButton">
+       <property name="text">
+        <string>Software</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_8">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
   </layout>
  </widget>
  <customwidgets>
   <tabstop>mouseWheelScrollRadioButton</tabstop>
   <tabstop>mouseWheelBrowseRadioButton</tabstop>
   <tabstop>kcfg_EnlargeSmallerImages</tabstop>
-  <tabstop>glAnimationRadioButton</tabstop>
   <tabstop>softwareAnimationRadioButton</tabstop>
   <tabstop>noAnimationRadioButton</tabstop>
   <tabstop>horizontalRadioButton</tabstop>
index 2a7ee25..90a1ae0 100644 (file)
@@ -126,9 +126,4 @@ target_link_libraries(gwenviewlib
     ${PNG_LIBRARIES}
 )
 
-if(QT_QTOPENGL_FOUND)
-    add_definitions(-DHAVE_OPENGL)
-    target_link_libraries(gwenviewlib ${QT_QTOPENGL_LIBRARY})
-endif()
-
 install(TARGETS gwenviewlib ${INSTALL_TARGETS_DEFAULT_ARGS})
index 36447c8..5c97ebc 100644 (file)
@@ -73,8 +73,7 @@ public:
 
     enum AnimationMethod {
         NoAnimation,
-        SoftwareAnimation,
-        GLAnimation
+        SoftwareAnimation
     };
 
     /**
index e4a2607..fa7e3db 100644 (file)
@@ -36,9 +36,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
 #include <QGraphicsScene>
 #include <QPropertyAnimation>
 #include <QTimer>
-#if defined(HAVE_OPENGL)
-#  include <QGL>
-#endif
 
 // libc
 #include <qmath.h>
@@ -93,17 +90,6 @@ DocumentViewContainer::DocumentViewContainer(QWidget* parent)
 {
     d->q = this;
     d->mScene = new QGraphicsScene(this);
-#if defined(HAVE_OPENGL)
-    if (GwenviewConfig::animationMethod() == DocumentView::GLAnimation) {
-        QGLWidget* glWidget = new QGLWidget;
-        if (glWidget->isValid()) {
-            setViewport(glWidget);
-        } else {
-            kWarning() << "Failed to initialize OpenGL support!";
-            delete glWidget;
-        }
-    }
-#endif
     setScene(d->mScene);
     setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
 
@@ -115,8 +101,6 @@ DocumentViewContainer::DocumentViewContainer(QWidget* parent)
     d->mLayoutUpdateTimer->setInterval(0);
     d->mLayoutUpdateTimer->setSingleShot(true);
     connect(d->mLayoutUpdateTimer, SIGNAL(timeout()), SLOT(updateLayout()));
-
-    connect(GwenviewConfig::self(), SIGNAL(configChanged()), SLOT(slotConfigChanged()));
 }
 
 DocumentViewContainer::~DocumentViewContainer()
@@ -312,19 +296,6 @@ void DocumentViewContainer::slotFadeInFinished(DocumentView* view)
     view->setEraseBorders(false);
 }
 
-void DocumentViewContainer::slotConfigChanged()
-{
-#if defined(HAVE_OPENGL)
-    bool currentlyGL = qobject_cast<QGLWidget*>(viewport());
-    bool wantGL = GwenviewConfig::animationMethod() == DocumentView::GLAnimation;
-    if (currentlyGL != wantGL) {
-        setViewport(wantGL ? new QGLWidget() : new QWidget());
-    }
-#else
-    setViewport(new QWidget());
-#endif
-}
-
 void DocumentViewContainer::showMessageWidget(QGraphicsWidget* widget, Qt::Alignment align)
 {
     DocumentView* view = 0;
index 67dff4e..ef8cd4a 100644 (file)
@@ -91,7 +91,6 @@ private:
 private Q_SLOTS:
     void slotFadeInFinished(DocumentView*);
     void pretendFadeInFinished();
-    void slotConfigChanged();
 };
 
 } // namespace
index a5a012c..33aa580 100644 (file)
             <choices name="Gwenview::DocumentView::AnimationMethod">
                 <choice name="DocumentView::NoAnimation"/>
                 <choice name="DocumentView::SoftwareAnimation"/>
-                <choice name="DocumentView::GLAnimation"/>
             </choices>
             <default>DocumentView::SoftwareAnimation</default>
         </entry>