From ad4fc79b1c0531d4a87b39dc8e462c31dd0a5b06 Mon Sep 17 00:00:00 2001 From: Alexander Bruy Date: Mon, 27 Mar 2023 16:17:44 +0300 Subject: [PATCH] drop legacy storage migration logic --- app/androidutils.cpp | 168 ------------------------- app/androidutils.h | 15 --- app/appsettings.cpp | 34 ----- app/appsettings.h | 19 --- app/inpututils.cpp | 29 ----- app/inpututils.h | 3 - app/main.cpp | 17 --- app/qml/CMakeLists.txt | 1 - app/qml/main.qml | 8 -- app/qml/misc/LegacyFolderMigration.qml | 143 --------------------- app/test/testutilsfunctions.cpp | 55 -------- app/test/testutilsfunctions.h | 1 - 12 files changed, 493 deletions(-) delete mode 100644 app/qml/misc/LegacyFolderMigration.qml diff --git a/app/androidutils.cpp b/app/androidutils.cpp index 5c6ec3791..2adaddc1c 100644 --- a/app/androidutils.cpp +++ b/app/androidutils.cpp @@ -18,14 +18,8 @@ #include #include #include -#include - -#include -#include #include "coreutils.h" -#include "inpututils.h" -#include "appsettings.h" #endif AndroidUtils::AndroidUtils( QObject *parent ): QObject( parent ) @@ -115,168 +109,6 @@ QString AndroidUtils::readExif( const QString &filePath, const QString &tag ) #endif } -bool AndroidUtils::findLegacyFolder( QString &legacyFolderPath ) -{ -#ifdef ANDROID - legacyFolderPath = QStringLiteral(); - QString dataPathRaw = QStringLiteral( "INPUT" ); - - QFileInfo extDir( "/sdcard/" ); - if ( extDir.isDir() && extDir.isWritable() ) - { - // seems that this directory transposes to the latter one in case there is no sdcard attached - dataPathRaw = extDir.path() + "/" + dataPathRaw; - QDir d( dataPathRaw ); - if ( d.exists() ) - { - legacyFolderPath = dataPathRaw; - return true; - } - } - else - { - CoreUtils::log( "$$: Migration", "Ext path " + extDir.path() + " is not readable!" ); - - QStringList split = QDir::homePath().split( "/" ); // something like /data/user/0/uk.co.lutraconsulting/files - - QFileInfo usrDir( "/storage/emulated/" + split[2] + "/" ); - dataPathRaw = usrDir.path() + "/" + dataPathRaw; - - if ( usrDir.isDir() && usrDir.isWritable() ) - { - QDir d( dataPathRaw ); - if ( d.exists() ) - { - legacyFolderPath = dataPathRaw; - return true; - } - } - } -#else - Q_UNUSED( legacyFolderPath ); -#endif - return false; -} - -void AndroidUtils::migrateLegacyProjects( const QString &legacyFolder, const QString &scopedStorageFolder ) -{ -#ifdef ANDROID - QString legacyFolderProjects = legacyFolder + QStringLiteral( "/projects" ); - QString scopedStorageProjects = scopedStorageFolder + QStringLiteral( "/projects" ); - - CoreUtils::log( "LegacyFolderMigration", "Starting copy from:" + legacyFolderProjects + " to:" + scopedStorageProjects ); - - QDir legacyProjectsDir( legacyFolderProjects ); - QStringList projectsToCopy = legacyProjectsDir.entryList( QDir::NoDotAndDotDot | QDir::Dirs | QDir::Hidden ); - - int cnt = 0; - - emit migrationStarted( projectsToCopy.count() ); - emit migrationProgressed( cnt ); - - for ( const QString &project : projectsToCopy ) - { - bool copyResult = InputUtils::cpDir( legacyFolderProjects + "/" + project, scopedStorageProjects + "/" + project ); - if ( !copyResult ) - { - CoreUtils::log( "LegacyFolderMigration", "Could not copy project" + project + "!" ); - emit migrationFinished( false ); - return; - } - - emit migrationProgressed( ++cnt ); - } - - // Final step: rename legacy folder to indicate that projects were successfully migrated - QDir legacyFolderDir( legacyFolder ); - bool renameSuccessful = legacyFolderDir.rename( legacyFolder, legacyFolder + QStringLiteral( "_migrated" ) ); - if ( !renameSuccessful ) - { - CoreUtils::log( "LegacyFolderMigration", "Rename not successful, but data are copied" ); - // Even though the folder is not renamed, it is copied, hence do not copy it again in future - emit migrationFinished( true ); - return; - } - - emit migrationFinished( true ); -#else - Q_UNUSED( legacyFolder ); - Q_UNUSED( scopedStorageFolder ); -#endif -} - -void AndroidUtils::handleLegacyFolderMigration( AppSettings *appsettings, bool demoProjectsCopiedThisRun ) -{ -#ifdef ANDROID - // Step 1: already migrated? - do not copy - if ( appsettings->legacyFolderMigrated() ) - { - CoreUtils::log( "LegacyFolderMigration", "Ignoring legacy folder logic, already migrated!" ); - return; - } - - // Step 2: is this first run of application (after install or reset of all data)? - do not copy - if ( demoProjectsCopiedThisRun ) - { - CoreUtils::log( "LegacyFolderMigration", "Ignoring legacy folder logic, just installed or removed app data!" ); - appsettings->setLegacyFolderMigrated( true ); - return; - } - - // Step 3: make sure we have a WRITE permission to storage - // this check should not be that important since previous app versions could not run without this permission - all updated - // versions will thus have it granted. Anyways.. - QFuture res = QtAndroidPrivate::checkPermission( "android.permission.WRITE_EXTERNAL_STORAGE" ); - res.waitForFinished(); - if ( res.result() != QtAndroidPrivate::PermissionResult::Authorized ) - { - if ( !checkAndAcquirePermissions( "android.permission.WRITE_EXTERNAL_STORAGE" ) ) - { - showToast( tr( "Without storage permission you will not be able to access previous projects" ) ); - CoreUtils::log( "LegacyFolderMigration", "Storage permission not granted after rationale, leaving!" ); - return; - } - CoreUtils::log( "LegacyFolderMigration", "Storage permission granted after rationale, continuing!" ); - } - - // Step 4: check existence of legacy folder - QString legacyFolderPath; - bool containsLegacyFolder = findLegacyFolder( legacyFolderPath ); - - if ( !containsLegacyFolder ) - { - appsettings->setLegacyFolderMigrated( true ); - CoreUtils::log( "LegacyFolderMigration", "Could not find legacy folder" ); - return; - } - - // Step 5: is there enough space to copy the folder? - // https://doc.qt.io/qt-5/qstorageinfo.html - QDir legacyDir( legacyFolderPath ); - QStorageInfo storage( legacyDir ); - - qint64 freeSpace = storage.bytesAvailable(); - qint64 neededSpace = InputUtils::dirSize( legacyFolderPath ); - - if ( freeSpace < neededSpace ) - { - emit notEnoughSpaceLeftToMigrate( InputUtils::bytesToHumanSize( neededSpace ) ); - CoreUtils::log( "LegacyFolderMigration", "Device does not have enough space to copy the folder, needed: " + \ - InputUtils::bytesToHumanSize( neededSpace ) + \ - " free space: " + InputUtils::bytesToHumanSize( freeSpace ) ); - return; - } - - // Step 6: finally, let's copy the projects folder, project after project - QtConcurrent::run( &AndroidUtils::migrateLegacyProjects, this, legacyFolderPath, externalStorageAppFolder() ); - - CoreUtils::log( "LegacyFolderMigration", "Data migration has been sent to other thread!" ); -#else - Q_UNUSED( appsettings ); - Q_UNUSED( demoProjectsCopiedThisRun ); -#endif -} - void AndroidUtils::turnBluetoothOn() { #ifdef ANDROID diff --git a/app/androidutils.h b/app/androidutils.h index f6495a65b..39f8c3d2b 100644 --- a/app/androidutils.h +++ b/app/androidutils.h @@ -19,8 +19,6 @@ #endif #include -class AppSettings; - class AndroidUtils: public QObject #ifdef ANDROID , QAndroidActivityResultReceiver @@ -50,13 +48,6 @@ class AndroidUtils: public QObject bool requestCameraPermission(); bool requestMediaLocationPermission(); - // Copies legacy app folder INPUT from external storage to app specific folder based on several rules. - // Returns true if migration has been done, false otherwise - void handleLegacyFolderMigration( AppSettings *appsettings, bool demoProjectsCopiedThisRun ); - - bool findLegacyFolder( QString &legacyFolderPath ); - void migrateLegacyProjects( const QString &from, const QString &to ); - void turnBluetoothOn(); bool isBluetoothTurnedOn(); @@ -85,11 +76,6 @@ class AndroidUtils: public QObject signals: void imageSelected( QString imagePath ); - void migrationFinished( bool success ); - void migrationProgressed( int progress ); - void migrationStarted( int numOfProjectsToCopy ); - void notEnoughSpaceLeftToMigrate( QString neededSpace ); - void bluetoothEnabled( bool state ); void qrScanFinished( QString scanValue ); @@ -100,7 +86,6 @@ class AndroidUtils: public QObject void showToast( QString message ); private: - bool mIsAndroid; #ifdef ANDROID QBluetoothLocalDevice mBluetooth; diff --git a/app/appsettings.cpp b/app/appsettings.cpp index e5857890e..46bb39747 100644 --- a/app/appsettings.cpp +++ b/app/appsettings.cpp @@ -30,8 +30,6 @@ AppSettings::AppSettings( QObject *parent ): QObject( parent ) int streamingIntervalType = settings.value( "intervalType", 0 ).toInt(); StreamingIntervalType::IntervalType intervalType = static_cast( streamingIntervalType ); bool reuseLastEnteredValues = settings.value( "reuseLastEnteredValues", false ).toBool(); - QString savedAppVersion = settings.value( QStringLiteral( "appVersion" ), QStringLiteral() ).toString(); - bool legacyFolderMigrated = settings.value( QStringLiteral( "legacyFolderMigrated" ), false ).toBool(); QString activeProviderId = settings.value( QStringLiteral( "activePositionProviderId" ) ).toString(); bool autosync = settings.value( QStringLiteral( "autosyncAllowed" ), false ).toBool(); bool ignoreWhatsNew = settings.value( QStringLiteral( "ignoreWhatsNew" ), false ).toBool(); @@ -49,8 +47,6 @@ AppSettings::AppSettings( QObject *parent ): QObject( parent ) setLineRecordingInterval( lineRecordingInterval ); setIntervalType( intervalType ); setReuseLastEnteredValues( reuseLastEnteredValues ); - setAppVersion( savedAppVersion ); - setLegacyFolderMigrated( legacyFolderMigrated ); setActivePositionProviderId( activeProviderId ); setAutosyncAllowed( autosync ); setIgnoreWhatsNew( ignoreWhatsNew ); @@ -220,36 +216,6 @@ void AppSettings::setGpsAccuracyWarning( bool gpsAccuracyWarning ) } } -QString AppSettings::appVersion() const -{ - return mAppVersion; -} - -void AppSettings::setAppVersion( const QString &newAppVersion ) -{ - if ( mAppVersion == newAppVersion ) - return; - - mAppVersion = newAppVersion; - setValue( QStringLiteral( "appVersion" ), newAppVersion ); - emit appVersionChanged( mAppVersion ); -} - -bool AppSettings::legacyFolderMigrated() -{ - return mLegacyFolderMigrated; -} - -void AppSettings::setLegacyFolderMigrated( bool hasBeenMigrated ) -{ - if ( mLegacyFolderMigrated == hasBeenMigrated ) - return; - - mLegacyFolderMigrated = hasBeenMigrated; - setValue( QStringLiteral( "legacyFolderMigrated" ), hasBeenMigrated ); - emit legacyFolderMigratedChanged( mLegacyFolderMigrated ); -} - const QString &AppSettings::activePositionProviderId() const { return mActivePositionProviderId; diff --git a/app/appsettings.h b/app/appsettings.h index 70933f551..6470e9d39 100644 --- a/app/appsettings.h +++ b/app/appsettings.h @@ -31,8 +31,6 @@ class AppSettings: public QObject Q_PROPERTY( double gpsAccuracyTolerance READ gpsAccuracyTolerance WRITE setGpsAccuracyTolerance NOTIFY gpsAccuracyToleranceChanged ) Q_PROPERTY( bool gpsAccuracyWarning READ gpsAccuracyWarning WRITE setGpsAccuracyWarning NOTIFY gpsAccuracyWarningChanged ) Q_PROPERTY( bool reuseLastEnteredValues READ reuseLastEnteredValues WRITE setReuseLastEnteredValues NOTIFY reuseLastEnteredValuesChanged ) - Q_PROPERTY( QString appVersion READ appVersion WRITE setAppVersion NOTIFY appVersionChanged ) - Q_PROPERTY( bool legacyFolderMigrated READ legacyFolderMigrated WRITE setLegacyFolderMigrated NOTIFY legacyFolderMigratedChanged ) Q_PROPERTY( QString activePositionProviderId READ activePositionProviderId WRITE setActivePositionProviderId NOTIFY activePositionProviderIdChanged ) Q_PROPERTY( bool autosyncAllowed READ autosyncAllowed WRITE setAutosyncAllowed NOTIFY autosyncAllowedChanged ) Q_PROPERTY( bool ignoreWhatsNew READ ignoreWhatsNew WRITE setIgnoreWhatsNew NOTIFY ignoreWhatsNewChanged ) @@ -73,12 +71,6 @@ class AppSettings: public QObject bool gpsAccuracyWarning() const; void setGpsAccuracyWarning( bool gpsAccuracyWarning ); - QString appVersion() const; - void setAppVersion( const QString &newAppVersion ); - - bool legacyFolderMigrated(); - void setLegacyFolderMigrated( bool hasBeenMigrated ); - // SavedPositionProviders property is read only when needed ~ not at startup time. // It returns list of all external position providers (does not include internal/simulated position providers) QVariantList savedPositionProviders() const; @@ -118,8 +110,6 @@ class AppSettings: public QObject void intervalTypeChanged(); void reuseLastEnteredValuesChanged( bool reuseLastEnteredValues ); - void legacyFolderMigratedChanged( bool legacyFolderMigrated ); - void appVersionChanged( const QString &version ); void activePositionProviderIdChanged( const QString & ); void autosyncAllowedChanged( bool autosyncAllowed ); @@ -141,15 +131,6 @@ class AppSettings: public QObject // Digitizing period in seconds int mLineRecordingInterval = 3; StreamingIntervalType::IntervalType mIntervalType = StreamingIntervalType::IntervalType::Time; - // Application version, helps to differentiate between app installation, update or regular run: - // 1. if the value is null, this run is first after installation (or after user reset application data in settings) - // 2. if the value is different from current version, this is first run after update - // 3. if the value is the same as current version, this is regular run - // these check is possible to do during startup (in main.cpp) - QString mAppVersion; - // signalizes if application has already successfully migrated legacy Android folder - // this flag can be removed in future (prob. jan 2022), all users should have app version higher than 1.0.2 at that time - bool mLegacyFolderMigrated; // Projects path -> defaultLayer name QHash mDefaultLayers; diff --git a/app/inpututils.cpp b/app/inpututils.cpp index 38cd9c70d..3886a9cd2 100644 --- a/app/inpututils.cpp +++ b/app/inpututils.cpp @@ -653,35 +653,6 @@ bool InputUtils::cpDir( const QString &srcPath, const QString &dstPath, bool onl return result; } -// https://stackoverflow.com/a/47854799/7875594 -qint64 InputUtils::dirSize( const QString &path ) -{ - qint64 size = 0; - QDir dir( path ); - - if ( !dir.exists() ) - { - return size; - } - - QStringList subFiles = dir.entryList( QDir::Files | QDir::Hidden ); - - for ( QString filePath : subFiles ) - { - QFileInfo fi( dir, filePath ); - size += fi.size(); - } - - // add size of child directories recursively - QStringList subDirs = dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden ); - - for ( QString subDirPath : subDirs ) - { - size += dirSize( path + QDir::separator() + subDirPath ); - } - return size; -} - QString InputUtils::renameWithDateTime( const QString &srcPath, const QDateTime &dateTime ) { if ( QFile::exists( srcPath ) ) diff --git a/app/inpututils.h b/app/inpututils.h index 51f8c3445..48a884498 100644 --- a/app/inpututils.h +++ b/app/inpututils.h @@ -150,9 +150,6 @@ class InputUtils: public QObject */ static bool cpDir( const QString &srcPath, const QString &dstPath, bool onlyDiffable = false ); - // Returns size of directory in bytes, 0 if path does not exist - static qint64 dirSize( const QString &path ); - static QString filesToString( QList files ); /** InputApp platform */ diff --git a/app/main.cpp b/app/main.cpp index 1783977f3..9c6d379ab 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -715,23 +715,6 @@ int main( int argc, char *argv[] ) QNativeInterface::QAndroidApplication::hideSplashScreen(); #endif - // Android scoped storage migration logic -#ifdef ANDROID - QObject::connect( &au, &AndroidUtils::migrationFinished, [ &localProjectsManager, &as ]( bool success ) - { - if ( success ) - { - localProjectsManager.reloadDataDir(); - } - as.setLegacyFolderMigrated( true ); - } ); - - au.handleLegacyFolderMigration( &as, hasLoadedDemoProjects ); -#endif - - // save app version to settings - as.setAppVersion( version ); - // Photos bigger that 512 MB (when uncompressed) will not load QImageReader::setAllocationLimit( 512 ); diff --git a/app/qml/CMakeLists.txt b/app/qml/CMakeLists.txt index 99d8f2151..a31896db7 100644 --- a/app/qml/CMakeLists.txt +++ b/app/qml/CMakeLists.txt @@ -83,7 +83,6 @@ set(MM_QML misc/AddPositionProviderPage.qml misc/AttentionBanner.qml misc/GpsDataPage.qml - misc/LegacyFolderMigration.qml misc/NoWorkspaceBanner.qml misc/PositionProviderPage.qml AboutPanel.qml diff --git a/app/qml/main.qml b/app/qml/main.qml index 01cc17310..eeb36de86 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -18,7 +18,6 @@ import Qt.labs.settings import lc 1.0 as InputClass import "./map" -import "./misc" import "./dialogs" import "./layers" @@ -750,13 +749,6 @@ ApplicationWindow { } } - LegacyFolderMigration { - id: lfm - - z: 1000 // unfortunatelly we need this hack because some parts of application still sets z coord - anchors.fill: parent - } - Timer { id: closeAppTimer diff --git a/app/qml/misc/LegacyFolderMigration.qml b/app/qml/misc/LegacyFolderMigration.qml deleted file mode 100644 index 188cbc189..000000000 --- a/app/qml/misc/LegacyFolderMigration.qml +++ /dev/null @@ -1,143 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Dialogs -import QtQuick.Layouts - -import "../" -import "../components" - -Item { - id: root - - property int numOfProjectsToCopy: 0 - property int numOfCopiedProjects: 0 - - MessageDialog { - id: notEnoughSpaceLeftdialog - - property string neededSpace: "" - - title: qsTr( "Insufficient space left on device" ) - - text: qsTr( "Your device is running out of space, you need %1 of free space in order to see your projects. Remove some files and come back or click Help to see other ways how to resolve this issue." ).arg( notEnoughSpaceLeftdialog.neededSpace ) - buttons: MessageDialog.Help | MessageDialog.Ignore - - onButtonClicked: function(clickedButton) { - if (clickedButton === MessageDialog.Help) { - Qt.openUrlExternally( "https://www.lutraconsulting.co.uk/blog/2021/10/26/input-scoped-storage-update/" ) - } - close() - } - } - - MessageDialog { - id: migrationFailureDialog - - title: qsTr( "An error occured during update" ) - text: qsTr( "Your device run into a problem during applying an update. You will not be able to see your projects. Click Help to see how to resolve this issue." ) - buttons: MessageDialog.Help | MessageDialog.Ignore - - onButtonClicked: function(clickedButton) { - if (clickedButton === MessageDialog.Help) { - Qt.openUrlExternally( "https://www.lutraconsulting.co.uk/blog/2021/10/26/input-scoped-storage-update/" ) - } - close() - } - } - - Connections { - target: __androidUtils - - function onMigrationStarted( numOfProjectsToCopy ) { - root.numOfProjectsToCopy = numOfProjectsToCopy - migrationInProgress.visible = true - } - - function onMigrationProgressed( progress ) { - root.numOfCopiedProjects = progress - } - - function onMigrationFinished( success ) { - migrationInProgress.visible = false - - if ( !success ) - { - migrationFailureDialog.open() - } - } - - function onNotEnoughSpaceLeftToMigrate( neededSpace ) { - notEnoughSpaceLeftdialog.neededSpace = neededSpace - notEnoughSpaceLeftdialog.open() - } - } - - Rectangle { - id: migrationInProgress - - anchors.fill: parent - color: InputStyle.clrPanelMain - - visible: false - - MouseArea { - anchors.fill: parent - onClicked: {} // do not propagate clicks - } - - ColumnLayout { - anchors.fill: parent - - spacing: 0 - - BusyIndicator { - - Layout.alignment: Qt.AlignCenter - - Layout.preferredWidth: parent.width / 8 - Layout.preferredHeight: parent.width / 8 // the same as width - } - - Text { - text: qsTr( "We are working on an important update, please do not close the application" ) - - font.pixelSize: InputStyle.fontPixelSizeNormal - color: InputStyle.fontColor - - Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: parent.width * 0.8 - - horizontalAlignment: Text.AlignHCenter - elide: Text.ElideRight - wrapMode: Text.WordWrap - } - - Text { - text: qsTr( "%1/%2" ).arg( root.numOfCopiedProjects ).arg( root.numOfProjectsToCopy ) - - font.pixelSize: InputStyle.fontPixelSizeNormal - color: InputStyle.fontColor - - Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: parent.width * 0.8 - - horizontalAlignment: Text.AlignHCenter - elide: Text.ElideRight - wrapMode: Text.WordWrap - } - } - - Behavior on opacity { - NumberAnimation{ duration: 500 } - } - } -} diff --git a/app/test/testutilsfunctions.cpp b/app/test/testutilsfunctions.cpp index 28c7ac971..d36be2192 100644 --- a/app/test/testutilsfunctions.cpp +++ b/app/test/testutilsfunctions.cpp @@ -325,61 +325,6 @@ void TestUtilsFunctions::resolveTargetDir() QCOMPARE( resultDir3, QStringLiteral( "%1/photos" ).arg( projectDir ) ); } -void TestUtilsFunctions::testDirSize() -{ - // create some test data in tmp with non ascii characters - QString tempFolder = QTemporaryDir( QDir::tempPath() + "/input-testDirSize-XXXXXX" ).path(); - QString project = tempFolder + QStringLiteral( "/input-project" ); - qint64 dirSize; - - dirSize = mUtils->dirSize( project ); - QCOMPARE( dirSize, 0 ); - - QString subfolder = project + QStringLiteral( "/sub/sub/ž" ); - QDir subfolderDir( subfolder ); - subfolderDir.mkpath( subfolder ); - - QFile file1( subfolder + QStringLiteral( "/testfile1-žriebä" ) ); - file1.open( QIODevice::WriteOnly ); - - file1.write( "Loreem" ); - file1.close(); - - qint64 newDirSize = mUtils->dirSize( project ); - - QVERIFY( newDirSize > dirSize ); - - // add hidden folder and file and see if size gets bigger - QString hiddenFolder = project + QStringLiteral( "/.hide" ); - QDir hiddenFolderDir( hiddenFolder ); - hiddenFolderDir.mkpath( hiddenFolder ); - - QFile file2( hiddenFolder + QStringLiteral( "/.mergin" ) ); - file2.open( QIODevice::WriteOnly ); - - file2.write( "Loreem" ); - file2.close(); - - dirSize = newDirSize; - newDirSize = mUtils->dirSize( project ); - - QVERIFY( newDirSize > dirSize ); - - // test not existing folders - dirSize = mUtils->dirSize( tempFolder + QStringLiteral( "/notexistingfilesfolder_input" ) ); - QCOMPARE( dirSize, 0 ); - - // try to pass files - should ignore it and return 0 - QFile file3( tempFolder + QStringLiteral( "/.mergin" ) ); - file3.open( QIODevice::WriteOnly ); - - file3.write( "Loreem" ); - file3.close(); - - dirSize = mUtils->dirSize( tempFolder + QStringLiteral( "/.mergin" ) ); - QCOMPARE( dirSize, 0 ); -} - void TestUtilsFunctions::testExtractPointFromFeature() { FeatureLayerPair invalidPair; diff --git a/app/test/testutilsfunctions.h b/app/test/testutilsfunctions.h index 9aaa902f6..32de57076 100644 --- a/app/test/testutilsfunctions.h +++ b/app/test/testutilsfunctions.h @@ -35,7 +35,6 @@ class TestUtilsFunctions: public QObject void getRelativePath(); void resolvePhotoPath(); void resolveTargetDir(); - void testDirSize(); void testExtractPointFromFeature(); void testStakeoutPathExtent(); void testDistanceBetweenGpsAndFeature();