mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Fix ResMed import crash condition and break screenshots temporarily
This commit is contained in:
parent
aba8cc8052
commit
ac1d0be42b
@ -2633,6 +2633,7 @@ int ResmedLoader::Open(const QString & dirpath)
|
|||||||
for (auto & sess : day->sessions) {
|
for (auto & sess : day->sessions) {
|
||||||
if (sess->type() == MT_CPAP) {
|
if (sess->type() == MT_CPAP) {
|
||||||
day->removeSession(sess);
|
day->removeSession(sess);
|
||||||
|
mach->sessionlist.remove(sess->session());
|
||||||
delete sess;
|
delete sess;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2675,8 +2676,6 @@ int ResmedLoader::Open(const QString & dirpath)
|
|||||||
|
|
||||||
finishAddingSessions();
|
finishAddingSessions();
|
||||||
|
|
||||||
mach->SaveSummary();
|
|
||||||
|
|
||||||
#ifdef DEBUG_EFFICIENCY
|
#ifdef DEBUG_EFFICIENCY
|
||||||
{
|
{
|
||||||
qint64 totalbytes = 0;
|
qint64 totalbytes = 0;
|
||||||
|
@ -607,6 +607,12 @@ int MainWindow::importCPAP(ImportPath import, const QString &message)
|
|||||||
void MainWindow::finishCPAPImport()
|
void MainWindow::finishCPAPImport()
|
||||||
{
|
{
|
||||||
p_profile->StoreMachines();
|
p_profile->StoreMachines();
|
||||||
|
QList<Machine *> machines = p_profile->GetMachines(MT_CPAP);
|
||||||
|
for (Machine * mach : machines) {
|
||||||
|
mach->saveSessionInfo();
|
||||||
|
mach->SaveSummary();
|
||||||
|
}
|
||||||
|
|
||||||
GenerateStatistics();
|
GenerateStatistics();
|
||||||
profileSelector->updateProfileList();
|
profileSelector->updateProfileList();
|
||||||
|
|
||||||
@ -1300,29 +1306,22 @@ void MainWindow::on_action_Screenshot_triggered()
|
|||||||
}
|
}
|
||||||
void MainWindow::DelayedScreenshot()
|
void MainWindow::DelayedScreenshot()
|
||||||
{
|
{
|
||||||
int w = width();
|
// Make sure to scale for high resolution displays (like Retina)
|
||||||
int h = height();
|
|
||||||
|
|
||||||
// Scale for high resolution displays (like Retina)
|
|
||||||
#if(QT_VERSION>=QT_VERSION_CHECK(5,0,0))
|
|
||||||
qreal pr = devicePixelRatio();
|
qreal pr = devicePixelRatio();
|
||||||
w /= pr;
|
|
||||||
h /= pr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(Q_OS_WIN) || defined(Q_OS_LINUX) || defined(Q_OS_HAIKU)
|
|
||||||
Q_UNUSED(w)
|
|
||||||
Q_UNUSED(h)
|
|
||||||
//QRect rec = QApplication::desktop()->screenGeometry();
|
|
||||||
|
|
||||||
|
QPixmap pixmap=grab();
|
||||||
|
|
||||||
|
/*#if defined(Q_OS_WIN) || defined(Q_OS_LINUX) || defined(Q_OS_HAIKU)
|
||||||
// grab the whole screen
|
// grab the whole screen
|
||||||
|
grab()
|
||||||
QPixmap desktop = QPixmap::grabWindow(QApplication::desktop()->winId());
|
QPixmap desktop = QPixmap::grabWindow(QApplication::desktop()->winId());
|
||||||
|
|
||||||
QPixmap pixmap = desktop.copy(x() * devicePixelRatio(), y() * devicePixelRatio(), (width()+6) * devicePixelRatio(), (height()+22) * devicePixelRatio());
|
QPixmap pixmap = desktop.copy(x() * pr, y() * pr, (width()+6) * pr, (height()+22) * pr);
|
||||||
|
|
||||||
#elif defined(Q_OS_MAC)
|
#elif defined(Q_OS_MAC)
|
||||||
QPixmap pixmap = QPixmap::grabWindow(this->winId(), x(), y(), w, h+10);
|
QPixmap pixmap = QPixmap::grabWindow(this->winId(), x(), y(), width() / pr, (height() / pr) + 10);
|
||||||
#endif
|
#endif */
|
||||||
|
|
||||||
QString a = PREF.Get("{home}/Screenshots");
|
QString a = PREF.Get("{home}/Screenshots");
|
||||||
QDir dir(a);
|
QDir dir(a);
|
||||||
|
Loading…
Reference in New Issue
Block a user