Guest User

Untitled

a guest
May 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. diff --git a/devices/neo/server/neosuspend.cpp b/devices/neo/server/neosuspend.cpp
  2. index 3023b70..8458fcc 100644
  3. --- a/devices/neo/server/neosuspend.cpp
  4. +++ b/devices/neo/server/neosuspend.cpp
  5. @@ -44,7 +44,8 @@ public:
  6. virtual bool canSuspend() const;
  7. virtual bool suspend();
  8. virtual bool wake();
  9. -private slots:
  10. +private:
  11. + QProcess afterSuspend;
  12. };
  13.  
  14. QTOPIA_DEMAND_TASK(NeoSuspend, NeoSuspend);
  15. @@ -66,6 +67,8 @@ bool NeoSuspend::suspend()
  16. {
  17. qLog(PowerManagement)<< __PRETTY_FUNCTION__;
  18.  
  19. + QProcess::execute("before-suspend.sh");
  20. +
  21. QFile powerStateFile("/sys/power/state");
  22. if( !powerStateFile.open(QIODevice::ReadWrite | QIODevice::Text | QIODevice::Truncate)) {
  23. qWarning()<<"File not opened";
  24. @@ -100,5 +103,12 @@ bool NeoSuspend::wake()
  25. QtopiaIpcEnvelope("QPE/NetworkState", "updateNetwork()"); //might have changed
  26. }
  27. #endif
  28. +
  29. + /* waitForFinished so that we can call start */
  30. + afterSuspend.waitForFinished();
  31. +
  32. + afterSuspend.start("after-suspend.sh");
  33. + /* no waitForFinished after start, because we want the command to complete in the background */
  34. +
  35. return true;
  36. }
Add Comment
Please, Sign In to add comment