[PATCH] Make Marble optional

Alberto Corona albcoron at gmail.com
Sat Mar 1 06:08:29 PST 2014


My intentions weren't to pass someone else's code as mine, hence
"Implemented some changes suggested by glance", though you're right, I
should have asked them first. Some of changes in the .pro and .pri files do
not work, I sent this in a bit premature (that's what I get for trying to
write a patch at 3 am). The blank widget does leave space where the marble
widget would be, if that would rather be completely taken out then there
would have to be changes in the splitters for the main window.


On Sat, Mar 1, 2014 at 7:19 AM, Anton Lundin <glance at acc.umu.se> wrote:

> On 01 March, 2014 - Alberto wrote:
>
> > From: Alberto Corona <albcoron at gmail.com>
> >
> > Implemented some changes suggested by glance
> > Building could now be done without having to have Marble installed
> > Fixes #394
> >
> > Signed-off-by: Alberto Corona <albcoron at gmail.com>
>
> I would suggest not taking this patch. The reason why i never submitted
> this patch is that is a crud hack to get things to build without marble.
>
> A proper patch would remote the whole panel from the ui, not leaving
> dead space there as this one does.
>
> The original patch doesn't carry a sob thus never formally approved for
> release, so just don't grab someone else code and submit it as yours.
> Adding some whitespace damage doesn't count as making it yours.
>
> If you grab someone else patch and rewrite it, check that they approved
> there code for release and give credit where credits due.
>
>
> //Anton
>
>
> > ---
> >  qt-ui/globe.cpp          | 11 +++++++++++
> >  qt-ui/globe.h            | 21 +++++++++++++++++++++
> >  qt-ui/mainwindow.h       |  1 +
> >  subsurface-configure.pri | 10 +++++++---
> >  subsurface.pro           |  2 +-
> >  5 files changed, 41 insertions(+), 4 deletions(-)
> >
> > diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
> > index 496afb4..7837ae7 100644
> > --- a/qt-ui/globe.cpp
> > +++ b/qt-ui/globe.cpp
> > @@ -1,4 +1,5 @@
> >  #include "globe.h"
> > +#ifndef NO_MARBLE
> >  #include "kmessagewidget.h"
> >  #include "mainwindow.h"
> >  #include "ui_mainwindow.h"
> > @@ -297,3 +298,13 @@ void GlobeGPS::resizeEvent(QResizeEvent *event)
> >               messageWidget->setGeometry(5, 5, size - 10, 0);
> >       messageWidget->setMaximumHeight(500);
> >  }
> > +
> > +#else
> > +
> > +GlobeGPS::GlobeGPS(QWidget *parent) {}
> > +void GlobeGPS::repopulateLabels() {}
> > +void GlobeGPS::centerOn(dive *dive) {}
> > +void GlobeGPS::prepareForGetDiveCoordinates() {}
> > +void GlobeGPS::reload() {}
> > +bool GlobeGPS::eventFilter(QObject *obj, QEvent *ev) {}
> > +#endif
> > diff --git a/qt-ui/globe.h b/qt-ui/globe.h
> > index 80d9613..e25f244 100644
> > --- a/qt-ui/globe.h
> > +++ b/qt-ui/globe.h
> > @@ -1,5 +1,6 @@
> >  #ifndef GLOBE_H
> >  #define GLOBE_H
> > +#ifndef NO_MARBLE
> >
> >  #include <marble/MarbleWidget.h>
> >  #include <marble/GeoDataCoordinates.h>
> > @@ -41,4 +42,24 @@ slots:
> >       void prepareForGetDiveCoordinates();
> >  };
> >
> > +#else
> > +
> > +#include <QWidget>
> > +
> > +struct dive;
> > +
> > +class GlobeGPS : public QWidget {
> > +        Q_OBJECT
> > +public:
> > +        GlobeGPS(QWidget *parent);
> > +        void reload();
> > +        void repopulateLabels();
> > +        void centerOn(struct dive *dive);
> > +        bool eventFilter(QObject *, QEvent *);
> > +public
> > +slots:
> > +        void prepareForGetDiveCoordinates();
> > +};
> > +
> > +#endif
> >  #endif // GLOBE_H
> > diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
> > index 1db3d5a..65a532c 100644
> > --- a/qt-ui/mainwindow.h
> > +++ b/qt-ui/mainwindow.h
> > @@ -9,6 +9,7 @@
> >
> >  #include <QMainWindow>
> >  #include <QAction>
> > +#include <QSettings>
> >  #include <QUrl>
> >
> >  #include "ui_mainwindow.h"
> > diff --git a/subsurface-configure.pri b/subsurface-configure.pri
> > index 8e6aead..fb48185 100644
> > --- a/subsurface-configure.pri
> > +++ b/subsurface-configure.pri
> > @@ -116,7 +116,6 @@ isEmpty(XML2_CFLAGS)|isEmpty(XML2_LIBS): \
> >  isEmpty(XSLT_CFLAGS)|isEmpty(XSLT_LIBS): \
> >       error("Could not find libxslt. Did you forget to install it?")
> >
> > -
> >  QMAKE_CFLAGS *= $$XML2_CFLAGS $$XSLT_CFLAGS
> >  QMAKE_CXXFLAGS *= $$XML2_CFLAGS $$XSLT_CFLAGS
> >  LIBS *= $$XSLT_LIBS $$XML2_LIBS
> > @@ -131,14 +130,19 @@ link_pkgconfig: PKGCONFIG += libzip sqlite3
> >  # Add libiconv if needed
> >  link_pkgconfig: packagesExist(libiconv): PKGCONFIG += libiconv
> >
> > +# Add Marble if present
> > +link_pkgconfig: packagesExist(libmarlbe): DEFINES += NO_MARBLE
> > +
> >  #
> >  # Find libmarble
> >  #
> >  # Before Marble 4.9, the GeoDataTreeModel.h header wasn't installed
> >  # Check if it's present by trying to compile
> >  # ### FIXME: implement that
> > -win32: CONFIG(debug, debug|release): LIBS += -lmarblewidgetd
> > -else: LIBS += -lmarblewidget
> > +!contains(DEFINES, NO_MARBLE) {
> > +        win32: CONFIG(debug, debug|release): LIBS += -lmarblewidgetd
> > +        else: LIBS += -lmarblewidget
> > +}
> >
> >  #
> >  # Platform-specific changes
> > diff --git a/subsurface.pro b/subsurface.pro
> > index 81cb906..49865d7 100644
> > --- a/subsurface.pro
> > +++ b/subsurface.pro
> > @@ -4,7 +4,7 @@ QT = core gui network svg
> >  lessThan(QT_MAJOR_VERSION, 5) {
> >       QT += webkit
> >  } else {
> > -     QT += webkitwidgets
> > +     !android: QT += webkitwidgets
> >  }
> >  INCLUDEPATH += qt-ui $$PWD
> >  DEPENDPATH += qt-ui
> > --
> > 1.8.5.3
> >
> > _______________________________________________
> > subsurface mailing list
> > subsurface at hohndel.org
> > http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
> --
> Anton Lundin    +46702-161604
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140301/710cfb67/attachment-0001.html>


More information about the subsurface mailing list