comparison src/hgrunner.cpp @ 674:4283398d248f

Minor improvement to dialog spacing
author Chris Cannam
date Wed, 05 Dec 2018 13:21:09 +0000
parents 98a7fbbe9d88
children 5b3bcb2d0943
comparison
equal deleted inserted replaced
673:e4d18e8ef430 674:4283398d248f
482 482
483 pruneOldAuthFiles(); 483 pruneOldAuthFiles();
484 484
485 QByteArray fileExt = randomKey(); 485 QByteArray fileExt = randomKey();
486 if (fileExt == QByteArray()) { 486 if (fileExt == QByteArray()) {
487 DEBUG << "HgRunner::addExtensionOptions: Failed to get proper auth file ext" << endl; 487 DEBUG << "HgRunner::getAuthFilePath: Failed to get proper auth file ext" << endl;
488 return ""; 488 return "";
489 } 489 }
490 QString fileExt16 = QString::fromLocal8Bit(fileExt.toBase64()).left(16) 490 QString fileExt16 = QString::fromLocal8Bit(fileExt.toBase64()).left(16)
491 .replace('+', '-').replace('/', '_'); 491 .replace('+', '-').replace('/', '_');
492 QString path = QStandardPaths::writableLocation 492 QString path = QStandardPaths::writableLocation
493 (QStandardPaths::CacheLocation); 493 (QStandardPaths::CacheLocation);
494 QDir().mkpath(path); 494 QDir().mkpath(path);
495 if (path == "") { 495 if (path == "") {
496 DEBUG << "HgRunner::addExtensionOptions: Failed to get cache location" << endl; 496 DEBUG << "HgRunner::getAuthFilePath: Failed to get cache location" << endl;
497 return ""; 497 return "";
498 } 498 }
499 499
500 m_authFilePath = QString("%1/easyhg.%2.%3.dat").arg(path) 500 m_authFilePath = QString("%1/easyhg.%2.%3.dat").arg(path)
501 .arg(getpid()).arg(fileExt16); 501 .arg(getpid()).arg(fileExt16);
507 QString HgRunner::getAuthKey() 507 QString HgRunner::getAuthKey()
508 { 508 {
509 if (m_authKey == "") { 509 if (m_authKey == "") {
510 QByteArray key = randomKey(); 510 QByteArray key = randomKey();
511 if (key == QByteArray()) { 511 if (key == QByteArray()) {
512 DEBUG << "HgRunner::addExtensionOptions: Failed to get proper auth key" << endl; 512 DEBUG << "HgRunner::getAuthKey: Failed to get proper auth key" << endl;
513 return ""; 513 return "";
514 } 514 }
515 QString key16 = QString::fromLocal8Bit(key.toBase64()).left(16); 515 QString key16 = QString::fromLocal8Bit(key.toBase64()).left(16);
516 m_authKey = key16; 516 m_authKey = key16;
517 } 517 }