Your ROOT_URL in app.ini is http://git.osmesh.ru/ but you are visiting http://91.221.70.94:3000/MOS/OpenBoard/commit/a0c3c87b4b8e2e7b0c2a2db3b96d20c1fe414eff
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
15 additions and
8 deletions
src/adaptors/UBImportDocumentSetAdaptor.cpp
src/document/UBDocumentController.cpp
src/frameworks/UBFileSystemUtils.cpp
src/frameworks/UBFileSystemUtils.h
@ -94,11 +94,17 @@ QFileInfoList UBImportDocumentSetAdaptor::importData(const QString &zipFile, con
foreach ( QFileInfo readDir , tDir . entryInfoList ( QDir : : Dirs | QDir : : NoDotAndDotDot | QDir : : Hidden , QDir : : Name ) ) {
QString newFileName = readDir . fileName ( ) ;
if ( QFileInfo ( destination + " / " + readDir . fileName ( ) ) . exists ( ) ) {
newFileName = QFileInfo ( UBPersistenceManager : : persistenceManager ( ) - > generateUniqueDocumentPath ( tmpDir ) ) . fileName ( ) ;
if ( QFileInfo ( destination + " / " + newFileName ) . exists ( ) )
{
//if the generateUniqueDocumentPath is called twice in the same millisecond, the destination files are overwritten
do
{
newFileName = QFileInfo ( UBPersistenceManager : : persistenceManager ( ) - > generateUniqueDocumentPath ( tmpDir ) ) . fileName ( ) ;
} while ( QFileInfo ( destination + " / " + newFileName ) . exists ( ) ) ;
}
QString newFilePath = destination + " / " + newFileName ;
if ( UBFileSystemUtils : : copy ( readDir . absoluteFilePath ( ) , newFilePath ) ) {
if ( UBFileSystemUtils : : copy ( readDir . absoluteFilePath ( ) , newFilePath , true ) ) {
result . append ( newFilePath ) ;
}
}
@ -2786,6 +2786,8 @@ void UBDocumentController::importFile()
if ( fileInfo . suffix ( ) . toLower ( ) = = " ubx " ) {
UBPersistenceManager : : persistenceManager ( ) - > createDocumentProxiesStructure ( docManager - > importUbx ( filePath , UBSettings : : userDocumentDirectory ( ) ) , true ) ;
emit documentThumbnailsUpdated ( this ) ; // some documents might have been overwritten while not having the same page count
} else {
UBSettings : : settings ( ) - > lastImportFilePath - > set ( QVariant ( fileInfo . absolutePath ( ) ) ) ;
@ -121,7 +121,7 @@ bool UBFileSystemUtils::copyFile(const QString &source, const QString &destinati
bool UBFileSystemUtils : : copy ( const QString & source , const QString & destination , bool overwrite )
{
if ( QFileInfo ( source ) . isDir ( ) ) {
return copyDir ( source , destination ) ;
return copyDir ( source , destination , overwrite ) ;
} else {
return copyFile ( source , destination , overwrite ) ;
}
@ -280,7 +280,7 @@ bool UBFileSystemUtils::deleteDir(const QString& pDirPath)
}
bool UBFileSystemUtils : : copyDir ( const QString & pSourceDirPath , const QString & pTargetDirPath )
bool UBFileSystemUtils : : copyDir ( const QString & pSourceDirPath , const QString & pTargetDirPath , bool overwite )
{
if ( pSourceDirPath = = " " | | pSourceDirPath = = " . " | | pSourceDirPath = = " .. " )
return false ;
@ -304,8 +304,7 @@ bool UBFileSystemUtils::copyDir(const QString& pSourceDirPath, const QString& pT
}
else
{
QFile f ( pSourceDirPath + " / " + dirContent . fileName ( ) ) ;
successSoFar = f . copy ( pTargetDirPath + " / " + dirContent . fileName ( ) ) ;
successSoFar = copyFile ( pSourceDirPath + " / " + dirContent . fileName ( ) , pTargetDirPath + " / " + dirContent . fileName ( ) , overwite ) ;
}
}
else
@ -62,7 +62,7 @@ class UBFileSystemUtils : public QObject
static bool deleteDir ( const QString & pDirPath ) ;
static bool copyDir ( const QString & pSourceDirPath , const QString & pTargetDirPath ) ;
static bool copyDir ( const QString & pSourceDirPath , const QString & pTargetDirPath , bool overwrite = false ) ;
static bool moveDir ( const QString & pSourceDirPath , const QString & pTargetDirPath ) ;