[PATCH] Make Marble optional

Alberto Corona albcoron at gmail.com
Mon Mar 3 16:17:38 PST 2014


Ok so I've got things working now, though I'd like to see if Anton is ok
with the changes. Unfortunately, I'm not familiar enough with Qt to change
the way the splitters work in order to get rid of the blank dummy widget.


On Sat, Mar 1, 2014 at 10:01 AM, Alberto Corona <albcoron at gmail.com> wrote:

> Again, I apologize, my intentions were not to pass them solely as my own.
> I'll get things fixed with the qmake configurations, the panel and Anton's
> authorship if he sees the changes are optimal.
> On Mar 1, 2014 9:16 AM, "Dirk Hohndel" <dirk at hohndel.org> wrote:
>
>> On Sat, 2014-03-01 at 08:08 -0600, Alberto Corona wrote:
>> > 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.
>>
>> No. "some changes suggested by glance" means you talked to him and then
>> wrote the code.
>> That's entirely different from "I applied glance's commit, made a few
>> inconsequential changes and then signed it off as if I had written it".
>> That could be considered theft, it certainly is misrepresentation of
>> authorship.
>>
>> As mentioned in our Contributing page, we take authorship and chain of
>> approval rather seriously. So if you want to base your work on something
>> that Anton wrote, you'll have to either read his code and then
>> re-implement it yourself (that's what I think would be a good way to
>> learn how the code works), or you need to ask him to sign off on his
>> patch and then submit it as part of a series of patches where the
>> following ones are yours.
>>
>> As a maintainer I sign off on patches that I get and apply. I
>> occasionally make small changes to the code that is submitted. If they
>> are completely transparent (white space) I might not mention that (I
>> usually do if you go back through the commit log). If I do anything more
>> you'll see me add to the commit message with my name attached to the
>> comment. But then I leave the author as the original author and have my
>> SOB after theirs.
>>
>> So no, what you did is not acceptable.
>>
>> > 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.
>>
>> Yes, that was what this fix was all about. And I tried to explain this
>> both in the bug and on IRC.
>>
>> - make the build dependency in the .pro/.pri files depend on a config
>> flag
>> - use that flag to create a define that is passed through CFLAGS /
>> CXXFLAGS
>> - depending on that flag turn off the map widget and instead have the
>> dive list span the bottom part of the Subsurface window
>>
>> /D
>>
>>
>> > 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
>> >
>> >
>> > _______________________________________________
>> > subsurface mailing list
>> > subsurface at hohndel.org
>> > http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140303/4bc34bfb/attachment-0001.html>


More information about the subsurface mailing list