Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Insanely long OS shutdown time

Insanely long OS shutdown time

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 735 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kovand11
    wrote on last edited by
    #1

    systempaths.h
    @
    #ifndef SYSTEMPATHS_H
    #define SYSTEMPATHS_H

    #include <QObject>
    #include <QApplication>
    #include <QStandardPaths>

    class SystemPaths : public QObject
    {
    Q_OBJECT
    public:

    static QString defaultIniPath();
    static QString defaultCapturePath();
    
    //Fixed
    static QString licenecePath();
    static QString manualPath();
    static QString logPath();
    
    
    QString iniPath();
    QString capturePath();
    

    signals:

    void iniPathChanged(QString path);
    void capturePathChanged(QString path);
    

    public slots:

    void setIniPath(QString path);
    void setCapturePath(QString path);
    

    private:

    QString m_iniPath;
    QString m_capturePath;
    

    };
    @

    systempaths.cpp
    @
    #include "systempaths.h"

    //Defaults
    //
    QString SystemPaths::defaultIniPath()
    {
    return QApplication::applicationDirPath()+"/camera.ini";
    }

    QString SystemPaths::defaultCapturePath()
    {
    return QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
    }

    //Fixed
    //
    QString SystemPaths::licenecePath()
    {
    return QApplication::applicationDirPath() + "/licence.dat";
    }

    QString SystemPaths::manualPath()
    {
    return QApplication::applicationDirPath() + "/manual.pdf";
    }

    QString SystemPaths::logPath()
    {
    return QApplication::applicationDirPath() + "/log.txt";
    }

    //Getter
    //

    QString SystemPaths::iniPath()
    {
    return m_iniPath;
    }

    QString SystemPaths::capturePath()
    {
    return m_capturePath;
    }

    //Setter
    //

    void SystemPaths::setIniPath(QString path)
    {
    m_iniPath = path;
    emit iniPathChanged(m_iniPath);
    }

    void SystemPaths::setCapturePath(QString path)
    {
    m_capturePath = path;
    emit capturePathChanged(m_capturePath);
    }
    @

    With only using the static functions in several other classes, the following happened: (os: linux mint 17.1 Cinnamon x64)
    -I pushed the shutdown button (set to shut down, without question)
    -The application closed
    -But something pevented the os from shutting down for 15-20 sec

    After removing the class, and change all its usages, to the same code the class used, the problem disappeares.

    What was wrong with that class?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      maximus
      wrote on last edited by
      #2

      Hi, how do you call your class method, do you have an example of use that caused this? (Another class calling SystemPaths)

      Thanks


      Free Indoor Cycling Software - https://maximumtrainer.com

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved