@ -13,7 +13,6 @@
# include "frameworks/UBPlatformUtils.h"
# include "frameworks/UBPlatformUtils.h"
# include "frameworks/UBFileSystemUtils.h"
# include "frameworks/UBFileSystemUtils.h"
# include "frameworks/UBDesktopServices.h"
# include "frameworks/UBCryptoUtils.h"
# include "frameworks/UBCryptoUtils.h"
# include "UB.h"
# include "UB.h"
@ -294,15 +293,15 @@ void UBSettings::init()
mirroringRefreshRateInFps = new UBSetting ( this , " Mirroring " , " RefreshRateInFramePerSecond " , QVariant ( defaultRefreshRateInFramePerSecond ) ) ;
mirroringRefreshRateInFps = new UBSetting ( this , " Mirroring " , " RefreshRateInFramePerSecond " , QVariant ( defaultRefreshRateInFramePerSecond ) ) ;
lastImportFilePath = new UBSetting ( this , " Import " , " LastImportFilePath " , QVariant ( UB DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastImportFilePath = new UBSetting ( this , " Import " , " LastImportFilePath " , QVariant ( Q DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastImportFolderPath = new UBSetting ( this , " Import " , " LastImportFolderPath " , QVariant ( UB DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastImportFolderPath = new UBSetting ( this , " Import " , " LastImportFolderPath " , QVariant ( Q DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastExportFilePath = new UBSetting ( this , " Export " , " LastExportFilePath " , QVariant ( UB DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastExportFilePath = new UBSetting ( this , " Export " , " LastExportFilePath " , QVariant ( Q DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastExportDirPath = new UBSetting ( this , " Export " , " LastExportDirPath " , QVariant ( UB DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastExportDirPath = new UBSetting ( this , " Export " , " LastExportDirPath " , QVariant ( Q DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastImportToLibraryPath = new UBSetting ( this , " Library " , " LastImportToLibraryPath " , QVariant ( UB DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastImportToLibraryPath = new UBSetting ( this , " Library " , " LastImportToLibraryPath " , QVariant ( Q DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastPicturePath = new UBSetting ( this , " Library " , " LastPicturePath " , QVariant ( UB DesktopServices: : storageLocation ( QDesktopServices : : PicturesLocation ) ) ) ;
lastPicturePath = new UBSetting ( this , " Library " , " LastPicturePath " , QVariant ( Q DesktopServices: : storageLocation ( QDesktopServices : : PicturesLocation ) ) ) ;
lastWidgetPath = new UBSetting ( this , " Library " , " LastWidgetPath " , QVariant ( UB DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastWidgetPath = new UBSetting ( this , " Library " , " LastWidgetPath " , QVariant ( Q DesktopServices: : storageLocation ( QDesktopServices : : DocumentsLocation ) ) ) ;
lastVideoPath = new UBSetting ( this , " Library " , " LastVideoPath " , QVariant ( UB DesktopServices: : storageLocation ( QDesktopServices : : MoviesLocation ) ) ) ;
lastVideoPath = new UBSetting ( this , " Library " , " LastVideoPath " , QVariant ( Q DesktopServices: : storageLocation ( QDesktopServices : : MoviesLocation ) ) ) ;
defaultDocumentGroupName = tr ( " Untitled Documents " ) ;
defaultDocumentGroupName = tr ( " Untitled Documents " ) ;
documentTrashGroupName = tr ( " Trash " ) ;
documentTrashGroupName = tr ( " Trash " ) ;
@ -761,8 +760,8 @@ QString UBSettings::uniboardDataDirectory()
// ", defaulting to " + UBDesktopServices::storageLocation(QDesktopServices::DataLocation);
// ", defaulting to " + UBDesktopServices::storageLocation(QDesktopServices::DataLocation);
}
}
}
}
QString qtDataPath = UBFileSystemUtils : : normalizeFilePath ( UB DesktopServices: : storageLocation ( QDesktopServices : : DataLocation ) ) ;
QString qtDataPath = UBFileSystemUtils : : normalizeFilePath ( Q DesktopServices: : storageLocation ( QDesktopServices : : DataLocation ) ) ;
qtDataPath . replace ( " /Sankore " , " " ) ;
qtDataPath . replace ( " /Open- Sankore " , " " ) ;
return qtDataPath ;
return qtDataPath ;
}
}
@ -770,7 +769,7 @@ QString UBSettings::uniboardDataDirectory()
QString UBSettings : : uniboardUserImageDirectory ( )
QString UBSettings : : uniboardUserImageDirectory ( )
{
{
QString valideUserImageDirectory =
QString valideUserImageDirectory =
UB DesktopServices: : storageLocation ( QDesktopServices : : PicturesLocation )
Q DesktopServices: : storageLocation ( QDesktopServices : : PicturesLocation )
+ " / " + QCoreApplication : : applicationName ( ) ;
+ " / " + QCoreApplication : : applicationName ( ) ;
bool hasCreatedDir = false ;
bool hasCreatedDir = false ;
@ -852,9 +851,7 @@ QString UBSettings::defaultUserImagesDirectory()
QString UBSettings : : uniboardUserVideoDirectory ( )
QString UBSettings : : uniboardUserVideoDirectory ( )
{
{
QString valideUserVideoDirectory =
QString valideUserVideoDirectory =
UBDesktopServices : : storageLocation ( QDesktopServices : : MoviesLocation ) ;
QDesktopServices : : storageLocation ( QDesktopServices : : MoviesLocation ) ;
bool hasCreatedDir = false ;
// first look into the application settings
// first look into the application settings
if ( sAppSettings & & getAppSettings ( ) - > contains ( " App/UserVideoDirectory " ) )
if ( sAppSettings & & getAppSettings ( ) - > contains ( " App/UserVideoDirectory " ) )
@ -889,7 +886,6 @@ QString UBSettings::uniboardUserVideoDirectory()
if ( ! dir . exists ( ) )
if ( ! dir . exists ( ) )
{
{
dir . mkpath ( userVideoDirectory ) ;
dir . mkpath ( userVideoDirectory ) ;
hasCreatedDir = true ;
}
}
if ( dir . exists ( ) )
if ( dir . exists ( ) )
@ -898,7 +894,6 @@ QString UBSettings::uniboardUserVideoDirectory()
}
}
else
else
{
{
hasCreatedDir = false ;
qWarning ( ) < < " Failed to interpret App/UserVideoDirectory config : "
qWarning ( ) < < " Failed to interpret App/UserVideoDirectory config : "
+ getAppSettings ( ) - > value ( " App/UserVideoDirectory " ) . toString ( )
+ getAppSettings ( ) - > value ( " App/UserVideoDirectory " ) . toString ( )
+ " , defaulting to " + valideUserVideoDirectory ;
+ " , defaulting to " + valideUserVideoDirectory ;
@ -927,9 +922,7 @@ QString UBSettings::uniboardUserVideoDirectory()
QString UBSettings : : podcastRecordingDirectory ( )
QString UBSettings : : podcastRecordingDirectory ( )
{
{
QString validePodcastRecordingDirectory =
QString validePodcastRecordingDirectory =
UBDesktopServices : : storageLocation ( QDesktopServices : : DesktopLocation ) ;
QDesktopServices : : storageLocation ( QDesktopServices : : DesktopLocation ) ;
bool hasCreatedDir = false ;
// first look into the application settings
// first look into the application settings
if ( sAppSettings & & getAppSettings ( ) - > contains ( " Podcast/RecordingDirectory " ) )
if ( sAppSettings & & getAppSettings ( ) - > contains ( " Podcast/RecordingDirectory " ) )
@ -964,7 +957,6 @@ QString UBSettings::podcastRecordingDirectory()
if ( ! dir . exists ( ) )
if ( ! dir . exists ( ) )
{
{
dir . mkpath ( userPodcastRecordingDirectory ) ;
dir . mkpath ( userPodcastRecordingDirectory ) ;
hasCreatedDir = true ;
}
}
if ( dir . exists ( ) )
if ( dir . exists ( ) )
@ -973,7 +965,6 @@ QString UBSettings::podcastRecordingDirectory()
}
}
else
else
{
{
hasCreatedDir = false ;
qWarning ( ) < < " Failed to interpret Podcast/RecordingDirectory config : "
qWarning ( ) < < " Failed to interpret Podcast/RecordingDirectory config : "
+ getAppSettings ( ) - > value ( " Podcast/RecordingDirectory " ) . toString ( )
+ getAppSettings ( ) - > value ( " Podcast/RecordingDirectory " ) . toString ( )
+ " , defaulting to user Desktop " ;
+ " , defaulting to user Desktop " ;
@ -1099,8 +1090,6 @@ QString UBSettings::uniboardInteractiveUserDirectory()
{
{
QString valideUserInteractiveDirectory = uniboardDataDirectory ( ) + " /interactive content " ;
QString valideUserInteractiveDirectory = uniboardDataDirectory ( ) + " /interactive content " ;
bool hasCreatedDir = false ;
// first look into the application settings
// first look into the application settings
if ( sAppSettings & & getAppSettings ( ) - > contains ( " App/UserInteractiveContentDirectory " ) )
if ( sAppSettings & & getAppSettings ( ) - > contains ( " App/UserInteractiveContentDirectory " ) )
{
{
@ -1129,7 +1118,6 @@ QString UBSettings::uniboardInteractiveUserDirectory()
if ( ! dir . exists ( ) )
if ( ! dir . exists ( ) )
{
{
dir . mkpath ( userWidgetDirectory ) ;
dir . mkpath ( userWidgetDirectory ) ;
hasCreatedDir = true ;
}
}
if ( dir . exists ( ) )
if ( dir . exists ( ) )
@ -1138,7 +1126,6 @@ QString UBSettings::uniboardInteractiveUserDirectory()
}
}
else
else
{
{
hasCreatedDir = false ;
qWarning ( ) < < " Failed to interpret App/UserInteractiveContentDirectory config : "
qWarning ( ) < < " Failed to interpret App/UserInteractiveContentDirectory config : "
+ getAppSettings ( ) - > value ( " App/UserInteractiveContentDirectory " ) . toString ( )
+ getAppSettings ( ) - > value ( " App/UserInteractiveContentDirectory " ) . toString ( )
+ " , defaulting to " + valideUserInteractiveDirectory ;
+ " , defaulting to " + valideUserInteractiveDirectory ;
@ -1194,8 +1181,6 @@ QString UBSettings::uniboardInteractiveFavoritesDirectory()
{
{
QString valideUserInteractiveDirectory = uniboardDataDirectory ( ) + " /interactive favorites " ;
QString valideUserInteractiveDirectory = uniboardDataDirectory ( ) + " /interactive favorites " ;
bool hasCreatedDir = false ;
// first look into the application settings
// first look into the application settings
if ( sAppSettings & & getAppSettings ( ) - > contains ( " App/UserInteractiveFavoritesDirectory " ) )
if ( sAppSettings & & getAppSettings ( ) - > contains ( " App/UserInteractiveFavoritesDirectory " ) )
{
{
@ -1224,7 +1209,6 @@ QString UBSettings::uniboardInteractiveFavoritesDirectory()
if ( ! dir . exists ( ) )
if ( ! dir . exists ( ) )
{
{
dir . mkpath ( userWidgetDirectory ) ;
dir . mkpath ( userWidgetDirectory ) ;
hasCreatedDir = true ;
}
}
if ( dir . exists ( ) )
if ( dir . exists ( ) )
@ -1233,7 +1217,6 @@ QString UBSettings::uniboardInteractiveFavoritesDirectory()
}
}
else
else
{
{
hasCreatedDir = false ;
qWarning ( ) < < " Failed to interpret App/UserInteractiveFavoritesDirectory config : "
qWarning ( ) < < " Failed to interpret App/UserInteractiveFavoritesDirectory config : "
+ getAppSettings ( ) - > value ( " App/UserInteractiveFavoritesDirectory " ) . toString ( )
+ getAppSettings ( ) - > value ( " App/UserInteractiveFavoritesDirectory " ) . toString ( )
+ " , defaulting to " + valideUserInteractiveDirectory ;
+ " , defaulting to " + valideUserInteractiveDirectory ;