mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix #431, fix export cancels, and more debug prints
This commit is contained in:
parent
a8ca4aeadb
commit
68de366738
|
@ -46,6 +46,8 @@ QList<ToxFile> Core::fileRecvQueue;
|
|||
Core::Core(Camera* cam, QThread *coreThread, QString loadPath) :
|
||||
tox(nullptr), camera(cam), loadPath(loadPath)
|
||||
{
|
||||
qDebug() << "Core: loading Tox from" << loadPath;
|
||||
|
||||
videobuf = new uint8_t[videobufsize];
|
||||
videoBusyness=0;
|
||||
|
||||
|
@ -1184,6 +1186,13 @@ void Core::saveConfiguration(const QString& path)
|
|||
|
||||
void Core::switchConfiguration(QString profile)
|
||||
{
|
||||
if (profile.isEmpty())
|
||||
{
|
||||
qWarning() << "Core: got null profile to switch to, not switching";
|
||||
return;
|
||||
}
|
||||
else
|
||||
qDebug() << "Core: switching from" << Settings::getInstance().getCurrentProfile() << "to" << profile;
|
||||
saveConfiguration();
|
||||
|
||||
toxTimer->stop();
|
||||
|
|
|
@ -132,7 +132,8 @@ void IdentityForm::onExportClicked()
|
|||
QString path = QFileDialog::getSaveFileName(this, tr("Export profile", "save dialog title"),
|
||||
QDir::home().filePath(current),
|
||||
tr("Tox save file (*.tox)", "save dialog filter"));
|
||||
QFile::copy(QDir(Settings::getSettingsDirPath()).filePath(current), path);
|
||||
if (!path.isEmpty())
|
||||
QFile::copy(QDir(Settings::getSettingsDirPath()).filePath(current), path);
|
||||
}
|
||||
|
||||
void IdentityForm::onDeleteClicked()
|
||||
|
@ -157,6 +158,8 @@ void IdentityForm::onDeleteClicked()
|
|||
void IdentityForm::onImportClicked()
|
||||
{
|
||||
QString path = QFileDialog::getOpenFileName(this, tr("Import profile", "import dialog title"), QDir::homePath(), tr("Tox save file (*.tox)", "import dialog filter"));
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
QFileInfo info(path);
|
||||
QString profile = info.completeBaseName();
|
||||
QString profilePath = QDir(Settings::getSettingsDirPath()).filePath(profile + Core::TOX_EXT);
|
||||
|
|
Loading…
Reference in New Issue
Block a user