File tree 3 files changed +19
-6
lines changed
3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# A qTox profile migrater for OSX
4
+ now=$( date +" %m_%d_%Y-%H.%M.%S" )
5
+ bak=" ~/.Tox-Backup-$now "
6
+
4
7
echo " Figuring out if action is required ..."
5
- if [ -d ~ /Library/Prefrences /tox]
8
+ if [ -d ~ /Library/Preferences /tox ] ; then
6
9
echo " Moving profile(s) ..."
7
10
cp -r ~ /Library/Preferences/tox ~ /Library/Application\ Support/
8
11
mv ~ /Library/Application\ Support/tox/ ~ /Library/Application\ Support/Tox
9
- mv ~ /Library/Preferences/tox ~ /.Tox-Backup
12
+ mv ~ /Library/Preferences/tox ~ /.Tox-Backup- $now
10
13
echo " Done! You profile(s) have been moved! A back up coppy still exists at:"
11
- echo " ~/.Tox-Backup "
14
+ echo " $bak "
12
15
else
13
16
echo " Cannot locate old profile directory, profile migration not performed"
14
17
fi
Original file line number Diff line number Diff line change @@ -165,7 +165,8 @@ win32 {
165
165
contains (DEFINES, QTOX_PLATFORM_EXT ) { LIBS += -framework IOKit -framework CoreFoundation }
166
166
contains (DEFINES, QTOX_FILTER_AUDIO ) { LIBS += -lfilteraudio }
167
167
# Files to be includes into the qTox.app/Contents/Resources folder
168
- APP_RESOURCE.files = img/icons/qtox_profile.icns
168
+ # OSX-Migrater.sh part of migrateProfiles() compatabilty code
169
+ APP_RESOURCE.files = img/icons/qtox_profile.icns OSX-Migrater.sh
169
170
APP_RESOURCE.path = Contents/Resources
170
171
QMAKE_BUNDLE_DATA += APP_RESOURCE
171
172
# Dynamic versioning for Info.plist
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ void osx::moveToAppFolder()
84
84
}
85
85
}
86
86
}
87
-
87
+ // migrateProfiles() is compatabilty code that can be removed down the line when the time seems right.
88
88
void osx::migrateProfiles ()
89
89
{
90
90
QString oldPath = QDir::cleanPath (QStandardPaths::writableLocation (QStandardPaths::HomeLocation) + QDir::separator () +
@@ -100,11 +100,20 @@ void osx::migrateProfiles()
100
100
qDebug () << " OS X: Old settings directory detected migrating to default" ;
101
101
if ( !dir.rename (oldPath, newPath) )
102
102
{
103
- qDebug () << " OS X: Profile migration failed. ~/Library/Application Support/Tox already exists." ;
103
+ qDebug () << " OS X: Profile migration failed. ~/Library/Application Support/Tox already exists. Using alternate migration method." ;
104
+ QString OSXMigrater = " ../Resources/OSX-Migrater.sh" ;
105
+ QProcess::execute (OSXMigrater);
106
+ QMessageBox MigrateProfile;
107
+ MigrateProfile.setIcon (QMessageBox::Information);
108
+ MigrateProfile.setWindowModality (Qt::ApplicationModal);
109
+ MigrateProfile.setText (" Alternate profile migration method used." );
110
+ MigrateProfile.setInformativeText (" It has been detected that your profiles \n where migrated to the new settings directory; \n using the alternate migration method. \n\n A backup can be found in your: \n /Users/[USER]/.Tox-Backup[DATE-TIME] \n\n Just in case. \r\n " );
111
+ MigrateProfile.exec ();
104
112
}
105
113
}
106
114
else
107
115
{
108
116
qDebug () << " OS X: Old settings directory not detected" ;
109
117
}
110
118
}
119
+ // End migrateProfiles() compatibility code
You can’t perform that action at this time.
0 commit comments