bool Machine:
aveSessionInfo()
{
if (info.type == MT_JOURNAL) return false;
if (sessionlist.size() == 0) return false;
qDebug() << "Saving" << info.brand << "session info" << info.loadername;
QString filename = getDataPath() + "Sessions.info";
QFile file(filename);
if (!file.open(QFile::WriteOnly)) {
qDebug() << "Couldn't open" << filename << "for writing";
return false;
}
I'm scrolling thru the code. There is allot of it when it;s the first time.
There is a bunch of places where it tries to open a file and then checks to see if it's open. if it's not it output to debug. but says nothing to the user. and just continues.
But then i found places where it just trys to open the file and doesn't even check.
bool Session::StoreEvents()
{
QString path = s_machine->getEventsPath();
QDir dir;
dir.mkpath(path);
QString filename = path+QString().sprintf("%08lx.001", s_session);
QFile file(filename);
file.open(QIODevice::WriteOnly);
QByteArray headerbytes;
I think the traditional way is to do a try / catch like this
try {
file.open (QFile::WriteOnly);
while (something);
Do some stuff.
}
catch (const ifstream::failure& e) {
qDebug() << "Couldn't open" << filename << "for writing";
}
file.close();
Probably best and wouldn't take much work to go thru the code search for all these open files, reads and write and block them in a try catch. send a message to the user and then send the actual os expecption to the debug. I mean all we see here that oscar couldn't open the file, we don't see why. If we had it in a try catch we could see why.
Community is people helping each other overcome some adversity. Sometimes it's a hurricane, other times it's a monopolist industry that benefits from keeping people in the dark about their own medical data or scaring them into thinking they aren't capable of managing their own treatment. Thankfully people will always develop community no mater what the adversity is.