summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ReleaseNotes/ReleaseNotes.txt1
-rw-r--r--core/dive.h4
-rw-r--r--core/pref.h1
-rw-r--r--core/prefs-macros.h10
-rw-r--r--core/subsurface-qt/DiveObjectHelper.cpp18
-rw-r--r--core/subsurface-qt/DiveObjectHelper.h2
-rw-r--r--core/subsurfacestartup.h1
-rw-r--r--desktop-widgets/configuredivecomputerdialog.cpp6
-rw-r--r--desktop-widgets/mainwindow.cpp3
-rw-r--r--desktop-widgets/preferences/preferencesdialog.cpp4
-rw-r--r--mobile-widgets/qml/DiveDetails.qml1
-rw-r--r--mobile-widgets/qml/DiveDetailsEdit.qml10
-rw-r--r--mobile-widgets/qmlmanager.cpp12
-rw-r--r--mobile-widgets/qmlmanager.h1
-rw-r--r--qt-models/diveimportedmodel.cpp3
-rw-r--r--qt-models/filtermodels.cpp86
-rw-r--r--qt-models/filtermodels.h19
-rw-r--r--scripts/android/travisbuild.sh3
-rwxr-xr-xscripts/build.sh6
-rw-r--r--scripts/linux/travisbuild.sh1
-rw-r--r--scripts/mac/travisbuild.sh24
-rw-r--r--scripts/windows/travisbuild.sh3
-rw-r--r--subsurface-mobile-main.cpp2
23 files changed, 146 insertions, 75 deletions
diff --git a/ReleaseNotes/ReleaseNotes.txt b/ReleaseNotes/ReleaseNotes.txt
index c37e2955d..10fdfa7d7 100644
--- a/ReleaseNotes/ReleaseNotes.txt
+++ b/ReleaseNotes/ReleaseNotes.txt
@@ -14,6 +14,7 @@ Some of the changes since _Subsurface_ 4.7.4
- Allow user defined cylinders as default in preferences (#821)
- mobile: fix black/white switch in splash screen (#531)
- UI: tag editing. Comma entry shows all tags (again) (#605)
+- mobile: enable auto completion for dive site entry (#546)
- Printing: the bundled templates are now read-only and are always overwritten
by the application. The first time the user runs this update, backup files
of the previous templates would be created. (#847).
diff --git a/core/dive.h b/core/dive.h
index 0f6fe192d..81396d352 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -525,10 +525,6 @@ static inline depth_t gas_mnd(struct gasmix *mix, depth_t end, struct dive *dive
#define SURFACE_THRESHOLD 750 /* somewhat arbitrary: only below 75cm is it really diving */
-/* this is a global spot for a temporary dive structure that we use to
- * be able to edit a dive without unintended side effects */
-extern struct dive edit_dive;
-
extern short autogroup;
/* random threashold: three days without diving -> new trip
* this works very well for people who usually dive as part of a trip and don't
diff --git a/core/pref.h b/core/pref.h
index 198d4b9fe..d25115c8e 100644
--- a/core/pref.h
+++ b/core/pref.h
@@ -189,6 +189,7 @@ extern const char *system_default_directory(void);
extern const char *system_default_filename();
extern bool subsurface_ignore_font(const char *font);
extern void subsurface_OS_pref_setup();
+extern void copy_prefs(struct preferences *src, struct preferences *dest);
#ifdef __cplusplus
}
diff --git a/core/prefs-macros.h b/core/prefs-macros.h
index 6f1b665fd..15a9a9867 100644
--- a/core/prefs-macros.h
+++ b/core/prefs-macros.h
@@ -18,10 +18,10 @@
else \
prefs.units.field = default_prefs.units.field
-#define GET_UNIT_BOOL(name, field) \
+#define GET_UNIT_BOOL(name, field) \
v = s.value(QString(name)); \
if (v.isValid()) \
- prefs.units.field = v.toBool(); \
+ prefs.units.field = v.toBool(); \
else \
prefs.units.field = default_prefs.units.field
@@ -53,10 +53,10 @@
else \
prefs.field = default_prefs.field
-#define GET_INT_DEF(name, field, defval) \
+#define GET_INT_DEF(name, field, defval) \
v = s.value(QString(name)); \
if (v.isValid()) \
- prefs.field = v.toInt(); \
+ prefs.field = v.toInt(); \
else \
prefs.field = defval
@@ -65,7 +65,7 @@
if (v.isValid()) \
prefs.field = strdup(v.toString().toUtf8().constData()); \
else \
- prefs.field = default_prefs.field
+ prefs.field = copy_string(default_prefs.field)
#define SAVE_OR_REMOVE_SPECIAL(_setting, _default, _compare, _value) \
if (_compare != _default) \
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp
index 8e5890b4c..8ea8b6370 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -426,6 +426,24 @@ QStringList DiveObjectHelper::suitList() const
return suits;
}
+QStringList DiveObjectHelper::locationList() const
+{
+ QStringList locations;
+ struct dive *d;
+ struct dive_site *ds;
+ int i = 0;
+ for_each_dive (i, d) {
+ if ((ds = get_dive_site_by_uuid(d->dive_site_uuid)) != NULL) {
+ QString temp = ds->name;
+ if (!temp.isEmpty())
+ locations << temp;
+ }
+ }
+ locations.removeDuplicates();
+ locations.sort();
+ return locations;
+}
+
QStringList DiveObjectHelper::buddyList() const
{
QStringList buddies;
diff --git a/core/subsurface-qt/DiveObjectHelper.h b/core/subsurface-qt/DiveObjectHelper.h
index 83aea4841..49542ca62 100644
--- a/core/subsurface-qt/DiveObjectHelper.h
+++ b/core/subsurface-qt/DiveObjectHelper.h
@@ -50,6 +50,7 @@ class DiveObjectHelper : public QObject {
Q_PROPERTY(QStringList suitList READ suitList CONSTANT)
Q_PROPERTY(QStringList buddyList READ buddyList CONSTANT)
Q_PROPERTY(QStringList divemasterList READ divemasterList CONSTANT)
+ Q_PROPERTY(QStringList locationList READ locationList CONSTANT)
public:
DiveObjectHelper(struct dive *dive = NULL);
~DiveObjectHelper();
@@ -93,6 +94,7 @@ public:
QString endPressure() const;
QString firstGas() const;
QStringList suitList() const;
+ QStringList locationList() const;
QStringList buddyList() const;
QStringList divemasterList() const;
diff --git a/core/subsurfacestartup.h b/core/subsurfacestartup.h
index b26c99025..40de09723 100644
--- a/core/subsurfacestartup.h
+++ b/core/subsurfacestartup.h
@@ -17,7 +17,6 @@ extern bool imported;
void setup_system_prefs(void);
void parse_argument(const char *arg);
void free_prefs(void);
-void copy_prefs(struct preferences *src, struct preferences *dest);
void print_files(void);
void print_version(void);
diff --git a/desktop-widgets/configuredivecomputerdialog.cpp b/desktop-widgets/configuredivecomputerdialog.cpp
index dd9913da4..4f5da16bf 100644
--- a/desktop-widgets/configuredivecomputerdialog.cpp
+++ b/desktop-widgets/configuredivecomputerdialog.cpp
@@ -904,8 +904,12 @@ void ConfigureDiveComputerDialog::configError(QString err)
void ConfigureDiveComputerDialog::getDeviceData()
{
+#ifdef BT_SUPPORT
QString device = ui.bluetoothMode && btDeviceSelectionDialog ?
btDeviceSelectionDialog->getSelectedDeviceAddress() : ui.device->currentText();
+#else
+ QString device = ui.device->currentText();
+#endif
device_data.devname = strdup(device.toUtf8().data());
device_data.vendor = strdup(selected_vendor.toUtf8().data());
device_data.product = strdup(selected_product.toUtf8().data());
@@ -915,8 +919,10 @@ void ConfigureDiveComputerDialog::getDeviceData()
auto dc = SettingsObjectWrapper::instance()->dive_computer_settings;
dc->setDevice(device_data.devname);
+#ifdef BT_SUPPORT
if (ui.bluetoothMode && btDeviceSelectionDialog)
dc->setDeviceName(btDeviceSelectionDialog->getSelectedDeviceName());
+#endif
}
void ConfigureDiveComputerDialog::on_cancel_clicked()
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index e5739bd47..330ea7d05 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -461,7 +461,7 @@ MainWindow *MainWindow::instance()
return m_Instance;
}
-// this gets called after we download dives from a divecomputer
+// This gets called after one or more dives were added, edited or downloaded for a dive computer
void MainWindow::refreshDisplay(bool doRecreateDiveList)
{
information()->reload();
@@ -485,6 +485,7 @@ void MainWindow::recreateDiveList()
BuddyFilterModel::instance()->repopulate();
LocationFilterModel::instance()->repopulate();
SuitsFilterModel::instance()->repopulate();
+ MultiFilterSortModel::instance()->myInvalidate();
}
void MainWindow::configureToolbar() {
diff --git a/desktop-widgets/preferences/preferencesdialog.cpp b/desktop-widgets/preferences/preferencesdialog.cpp
index 6f5f4b9fa..50a0049ac 100644
--- a/desktop-widgets/preferences/preferencesdialog.cpp
+++ b/desktop-widgets/preferences/preferencesdialog.cpp
@@ -109,7 +109,7 @@ void PreferencesDialog::refreshPages()
curr->setParent(0);
}
- // Readd things.
+ // Read things
Q_FOREACH(AbstractPreferencesWidget *page, pages) {
QListWidgetItem *item = new QListWidgetItem(page->icon(), page->name());
pagesList->addItem(item);
@@ -139,7 +139,7 @@ void PreferencesDialog::cancelRequested()
void PreferencesDialog::defaultsRequested()
{
- prefs = default_prefs;
+ copy_prefs(&default_prefs, &prefs);
Q_FOREACH(AbstractPreferencesWidget *page, pages) {
page->refreshSettings();
}
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml
index 2287b6348..dc0af53b6 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -24,6 +24,7 @@ Kirigami.Page {
property alias depth: detailsEdit.depthText
property alias duration: detailsEdit.durationText
property alias location: detailsEdit.locationText
+ property alias locationModel: detailsEdit.locationModel
property alias gps: detailsEdit.gpsText
property alias notes: detailsEdit.notesText
property alias suitIndex: detailsEdit.suitIndex
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml
index 431a0e22f..e369e5ab3 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -35,6 +35,7 @@ Item {
property alias divemasterModel: divemasterBox.model
property alias buddyModel: buddyBox.model
property alias cylinderModel: cylinderBox.model
+ property alias locationModel: txtLocation.model
property int rating
property int visibility
@@ -105,11 +106,14 @@ Item {
text: qsTr("Location:")
font.pointSize: subsurfaceTheme.smallPointSize
}
- Controls.TextField {
- id: txtLocation;
+ HintsTextEdit {
+ id: txtLocation
+ model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
+ diveDetailsListView.currentItem.modelData.dive.locationList : null
+ inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
onEditingFinished: {
- focus = false
+ gpsText = manager.getGpsFromSiteName(text)
}
}
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 2c28ccf83..a3f1b5730 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1536,6 +1536,18 @@ QString QMLManager::getVersion() const
return versionRe.cap(1);
}
+QString QMLManager::getGpsFromSiteName(const QString& siteName)
+{ uint32_t uuid;
+ struct dive_site *ds;
+
+ uuid = get_dive_site_uuid_by_name(qPrintable(siteName), NULL);
+ if (uuid) {
+ ds = get_dive_site_by_uuid(uuid);
+ return QString(printGPSCoords(ds->latitude.udeg, ds->longitude.udeg));
+ }
+ return "";
+}
+
QString QMLManager::notificationText() const
{
return m_notificationText;
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index cde8b8dec..548f01921 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -184,6 +184,7 @@ public slots:
QString getNumber(const QString& diveId);
QString getDate(const QString& diveId);
QString getCurrentPosition();
+ QString getGpsFromSiteName(const QString& siteName);
QString getVersion() const;
void deleteGpsFix(quint64 when);
void revertToNoCloudIfNeeded();
diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp
index 4cc5a0191..ea70ece39 100644
--- a/qt-models/diveimportedmodel.cpp
+++ b/qt-models/diveimportedmodel.cpp
@@ -180,7 +180,8 @@ void DiveImportedModel::recordDives()
}
diveTable->nr = 0;
process_dives(true, true);
- autogroup_dives();
+ if (autogroup)
+ autogroup_dives();
}
QHash<int, QByteArray> DiveImportedModel::roleNames() const {
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index 718611611..217d456bf 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -10,6 +10,7 @@
#endif
#include <QDebug>
+#include <algorithm>
#define CREATE_INSTANCE_METHOD( CLASS ) \
CLASS *CLASS::instance() \
@@ -39,8 +40,7 @@ bool CLASS::setData(const QModelIndex &index, const QVariant &value, int role) \
#define CREATE_CLEAR_FILTER_METHOD( CLASS ) \
void CLASS::clearFilter() \
{ \
- memset(checkState, false, rowCount()); \
- checkState[rowCount() - 1] = false; \
+ std::fill(checkState.begin(), checkState.end(), false); \
anyChecked = false; \
emit dataChanged(createIndex(0,0), createIndex(rowCount()-1, 0)); \
}
@@ -78,7 +78,40 @@ CREATE_COMMON_METHODS_FOR_FILTER(SuitsFilterModel, count_dives_with_suit)
CREATE_INSTANCE_METHOD(MultiFilterSortModel)
-SuitsFilterModel::SuitsFilterModel(QObject *parent) : QStringListModel(parent)
+FilterModelBase::FilterModelBase(QObject *parent) : QStringListModel(parent)
+{
+}
+
+// Update the stringList and the checkState array.
+// The last item is supposed to be the "Show Empty Tags" entry.
+void FilterModelBase::updateList(const QStringList &newList)
+{
+ // Keep copy of old checkState array to reimport them later.
+ std::vector<char> oldCheckState = checkState;
+ checkState.resize(newList.count());
+ std::fill(checkState.begin(), checkState.end(), false);
+ anyChecked = false;
+
+ // Ignore last item, since this is the "Show Empty Tags" entry.
+ for (int i = 0; i < rowCount() - 1; i++) {
+ if (oldCheckState[i]) {
+ int ind = newList.indexOf(stringList()[i]);
+ if (ind >= 0 && ind < newList.count() - 1) {
+ checkState[ind] = true;
+ anyChecked = true;
+ }
+ }
+ }
+
+ // On program startup, the old list is empty.
+ if (rowCount() > 0 && oldCheckState.back()) {
+ checkState.back() = true;
+ anyChecked = true;
+ }
+ setStringList(newList);
+}
+
+SuitsFilterModel::SuitsFilterModel(QObject *parent) : FilterModelBase(parent)
{
}
@@ -127,15 +160,10 @@ void SuitsFilterModel::repopulate()
}
qSort(list);
list << tr("No suit set");
- setStringList(list);
- delete[] checkState;
- checkState = new bool[list.count()];
- memset(checkState, false, list.count());
- checkState[list.count() - 1] = false;
- anyChecked = false;
+ updateList(list);
}
-TagFilterModel::TagFilterModel(QObject *parent) : QStringListModel(parent)
+TagFilterModel::TagFilterModel(QObject *parent) : FilterModelBase(parent)
{
}
@@ -152,12 +180,7 @@ void TagFilterModel::repopulate()
}
qSort(list);
list << tr("Empty tags");
- setStringList(list);
- delete[] checkState;
- checkState = new bool[list.count()];
- memset(checkState, false, list.count());
- checkState[list.count() - 1] = false;
- anyChecked = false;
+ updateList(list);
}
bool TagFilterModel::doFilter(dive *d, QModelIndex &index0, QAbstractItemModel *sourceModel) const
@@ -194,7 +217,7 @@ bool TagFilterModel::doFilter(dive *d, QModelIndex &index0, QAbstractItemModel *
return false;
}
-BuddyFilterModel::BuddyFilterModel(QObject *parent) : QStringListModel(parent)
+BuddyFilterModel::BuddyFilterModel(QObject *parent) : FilterModelBase(parent)
{
}
@@ -247,15 +270,10 @@ void BuddyFilterModel::repopulate()
}
qSort(list);
list << tr("No buddies");
- setStringList(list);
- delete[] checkState;
- checkState = new bool[list.count()];
- memset(checkState, false, list.count());
- checkState[list.count() - 1] = false;
- anyChecked = false;
+ updateList(list);
}
-LocationFilterModel::LocationFilterModel(QObject *parent) : QStringListModel(parent)
+LocationFilterModel::LocationFilterModel(QObject *parent) : FilterModelBase(parent)
{
}
@@ -277,15 +295,12 @@ bool LocationFilterModel::doFilter(struct dive *d, QModelIndex &index0, QAbstrac
return true;
}
- // there is a location selected
+ // There is a location selected
QStringList locationList = stringList();
- if (!locationList.isEmpty()) {
- locationList.removeLast(); // remove the "Show Empty Tags";
- for (int i = 0; i < rowCount(); i++) {
- if (checkState[i] && (location.indexOf(stringList()[i]) != -1)) {
- return true;
- }
- }
+ // Ignore last item, since this is the "Show Empty Tags" entry
+ for (int i = 0; i < rowCount() - 1; i++) {
+ if (checkState[i] && location == locationList[i])
+ return true;
}
return false;
}
@@ -303,12 +318,7 @@ void LocationFilterModel::repopulate()
}
qSort(list);
list << tr("No location set");
- setStringList(list);
- delete[] checkState;
- checkState = new bool[list.count()];
- memset(checkState, false, list.count());
- checkState[list.count() - 1] = false;
- anyChecked = false;
+ updateList(list);
}
MultiFilterSortModel::MultiFilterSortModel(QObject *parent) :
diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h
index 992582776..3060f7cf3 100644
--- a/qt-models/filtermodels.h
+++ b/qt-models/filtermodels.h
@@ -5,17 +5,24 @@
#include <QStringListModel>
#include <QSortFilterProxyModel>
#include <stdint.h>
+#include <vector>
class MultiFilterInterface {
public:
- MultiFilterInterface() : checkState(NULL), anyChecked(false) {}
+ MultiFilterInterface() : anyChecked(false) {}
virtual bool doFilter(struct dive *d, QModelIndex &index0, QAbstractItemModel *sourceModel) const = 0;
virtual void clearFilter() = 0;
- bool *checkState;
+ std::vector<char> checkState;
bool anyChecked;
};
-class TagFilterModel : public QStringListModel, public MultiFilterInterface {
+class FilterModelBase : public QStringListModel, public MultiFilterInterface {
+protected:
+ explicit FilterModelBase(QObject *parent = 0);
+ void updateList(const QStringList &new_list);
+};
+
+class TagFilterModel : public FilterModelBase {
Q_OBJECT
public:
static TagFilterModel *instance();
@@ -32,7 +39,7 @@ private:
explicit TagFilterModel(QObject *parent = 0);
};
-class BuddyFilterModel : public QStringListModel, public MultiFilterInterface {
+class BuddyFilterModel : public FilterModelBase {
Q_OBJECT
public:
static BuddyFilterModel *instance();
@@ -49,7 +56,7 @@ private:
explicit BuddyFilterModel(QObject *parent = 0);
};
-class LocationFilterModel : public QStringListModel, public MultiFilterInterface {
+class LocationFilterModel : public FilterModelBase {
Q_OBJECT
public:
static LocationFilterModel *instance();
@@ -66,7 +73,7 @@ private:
explicit LocationFilterModel(QObject *parent = 0);
};
-class SuitsFilterModel : public QStringListModel, public MultiFilterInterface {
+class SuitsFilterModel : public FilterModelBase {
Q_OBJECT
public:
static SuitsFilterModel *instance();
diff --git a/scripts/android/travisbuild.sh b/scripts/android/travisbuild.sh
index 4887ea684..8cec02585 100644
--- a/scripts/android/travisbuild.sh
+++ b/scripts/android/travisbuild.sh
@@ -1,5 +1,8 @@
#!/bin/bash
+set -x
+set -e
+
docker exec -t builder subsurface/packaging/android/android-build-wrapper.sh
# Extract the built apk from the builder container
diff --git a/scripts/build.sh b/scripts/build.sh
index 23b978efa..6b214a866 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -451,9 +451,6 @@ if [ "$SKIP_GOOGLEMAPS" != "1" ] ; then
git checkout master
git pull --rebase
- # remove the qt_build_config from .qmake.conf as that fails on Travis
- sed -i '' 's/.*qt_build_config.*//' .qmake.conf
-
mkdir -p build
cd build
$QMAKE -query
@@ -461,7 +458,8 @@ if [ "$SKIP_GOOGLEMAPS" != "1" ] ; then
# on Travis the compiler doesn't support c++1z, yet qmake adds that flag;
# since things compile fine with c++11, let's just hack that away
# similarly, don't use -Wdata-time
- sed -i 's/std=c++1z/std=c++11/g ; s/-Wdate-time//' Makefile
+ mv Makefile Makefile.bak
+ cat Makefile.bak | sed -e 's/std=c++1z/std=c++11/g ; s/-Wdate-time//' > Makefile
make -j4
make install
fi
diff --git a/scripts/linux/travisbuild.sh b/scripts/linux/travisbuild.sh
index 244320d8d..3e48544f6 100644
--- a/scripts/linux/travisbuild.sh
+++ b/scripts/linux/travisbuild.sh
@@ -1,6 +1,7 @@
#!/bin/bash
set -x
+set -e
# this gets executed by Travis when building an AppImage for Linux
# it gets started from inside the subsurface directory
diff --git a/scripts/mac/travisbuild.sh b/scripts/mac/travisbuild.sh
index f056f3e86..40fad844f 100644
--- a/scripts/mac/travisbuild.sh
+++ b/scripts/mac/travisbuild.sh
@@ -1,5 +1,8 @@
#!/bin/bash
+set -x
+set -e
+
# this gets executed by Travis when building an App for Mac
# it gets started from inside the subsurface directory
@@ -12,8 +15,7 @@ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
cd ${TRAVIS_BUILD_DIR}/..
DIR=$(pwd)
-#bash -e -x ./subsurface/scripts/build.sh -desktop -build-with-webkit # we need to build 'both' and need to build without BT and other variations that we want to exercise
-bash -e -x ./subsurface/scripts/build.sh -desktop -build-with-webkit -skip-googlemaps
+bash -e -x ./subsurface/scripts/build.sh -desktop -build-with-webkit
cd ${TRAVIS_BUILD_DIR}/build
@@ -31,17 +33,21 @@ for i in libgit2 libGrantlee_TextDocument.dylib libGrantlee_Templates.dylib; do
install_name_tool -change ${OLD} @executable_path/../Frameworks/${SONAME} ${EXECUTABLE}
install_name_tool -id @executable_path/../Frameworks/${SONAME} Subsurface.app/Contents/Frameworks/${SONAME}
# also fix incorrect references inside of libgit2
- if [[ "$i" = "libgit2" ]] ; then
- CURLLIB=$(otool -L Subsurface.app/Contents/Frameworks/${SONAME} | grep libcurl | cut -d\ -f1 | tr -d "\t")
- install_name_tool -change ${CURLLIB} @executable_path/../Frameworks/$(basename ${CURLLIB}) Subsurface.app/Contents/Frameworks/${SONAME}
- SSHLIB=$(otool -L Subsurface.app/Contents/Frameworks/${SONAME} | grep libssh2 | cut -d\ -f1 | tr -d "\t")
- install_name_tool -change ${SSHLIB} @executable_path/../Frameworks/$(basename ${SSHLIB}) Subsurface.app/Contents/Frameworks/${SONAME}
- fi
+ # if [[ "$i" = "libgit2" ]] ; then
+ # CURLLIB=$(otool -L Subsurface.app/Contents/Frameworks/${SONAME} | grep libcurl | cut -d\ -f1 | tr -d "\t")
+ # if [ ! -z $CURLLIB ] ; then
+ # install_name_tool -change ${CURLLIB} @executable_path/../Frameworks/$(basename ${CURLLIB}) Subsurface.app/Contents/Frameworks/${SONAME}
+ # fi
+ # SSHLIB=$(otool -L Subsurface.app/Contents/Frameworks/${SONAME} | grep libssh2 | cut -d\ -f1 | tr -d "\t")
+ # if [ ! -z $SSHLIB ] ; then
+ # install_name_tool -change ${SSHLIB} @executable_path/../Frameworks/$(basename ${SSHLIB}) Subsurface.app/Contents/Frameworks/${SONAME}
+ # fi
+ # fi
fi
done
# next, copy libssh2.1
-cp ${DIR}/install-root/lib/libssh2.1.dylib Subsurface.app/Contents/Frameworks
+# cp ${DIR}/install-root/lib/libssh2.1.dylib Subsurface.app/Contents/Frameworks
# next, replace @rpath references with @executable_path references in Subsurface
RPATH=$(otool -L ${EXECUTABLE} | grep rpath | cut -d\ -f1 | tr -d "\t" | cut -b 8- )
diff --git a/scripts/windows/travisbuild.sh b/scripts/windows/travisbuild.sh
index e8455ea87..6ca94c888 100644
--- a/scripts/windows/travisbuild.sh
+++ b/scripts/windows/travisbuild.sh
@@ -1,5 +1,8 @@
#!/bin/bash
+set -x
+set -e
+
# this gets executed by Travis when building an installer for Windows
# it gets started from inside the subsurface directory
# with all the other projects downloaded and installed in parralel to
diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp
index 0ee2890c6..63add7c50 100644
--- a/subsurface-mobile-main.cpp
+++ b/subsurface-mobile-main.cpp
@@ -41,7 +41,7 @@ int main(int argc, char **argv)
setup_system_prefs();
if (uiLanguage(0).contains("-US"))
default_prefs.units = IMPERIAL_units;
- prefs = default_prefs;
+ copy_prefs(&default_prefs, &prefs);
fill_profile_color();
fill_computer_list();