Import error reporting
I was getting a crash, it was because of a set up problem, but having this helped me to figure it out.
This commit is contained in:
parent
16f2251019
commit
e82850411d
1 changed files with 7 additions and 2 deletions
|
@ -86,8 +86,13 @@ void Device::initPrivateKey()
|
|||
//TODO: It is redundant to have our own private key in every instance of Device, move this to a singleton somewhere (Daemon?)
|
||||
const QString privateKeyPath = KStandardDirs::locateLocal("appdata", "key.pem", true);
|
||||
QFile privKey(privateKeyPath);
|
||||
privKey.open(QIODevice::ReadOnly);
|
||||
m_privateKey = QCA::PrivateKey::fromPEM(privKey.readAll());
|
||||
if (privKey.open(QIODevice::ReadOnly))
|
||||
m_privateKey = QCA::PrivateKey::fromPEM(privKey.readAll());
|
||||
else {
|
||||
qWarning() << "Could not open the private key" << privateKeyPath;
|
||||
}
|
||||
|
||||
Q_ASSERT(!m_privateKey.isNull());
|
||||
}
|
||||
|
||||
Device::~Device()
|
||||
|
|
Loading…
Reference in a new issue