windowhelper.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. Copyright 2011 - Tommi Laukkanen (www.substanceofcode.com)
  3. This file is part of TwimGo.
  4. NewsFlow is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. Foobar is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with NewsFlow. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #include "windowhelper.h"
  16. #ifdef Q_WS_MAEMO_5
  17. #include <QtDBus>
  18. #include <QDBusConnection>
  19. #include <QDBusMessage>
  20. #endif
  21. WindowHelper::WindowHelper(QObject *parent) :
  22. QObject(parent)
  23. {
  24. }
  25. Q_INVOKABLE void WindowHelper::minimize()
  26. {
  27. #ifdef Q_WS_MAEMO_5
  28. QDBusConnection c = QDBusConnection::sessionBus();
  29. QDBusMessage m = QDBusMessage::createSignal("/", "com.nokia.hildon_desktop", "exit_app_view");
  30. c.send(m);
  31. c.send(m);
  32. #endif
  33. }
  34. Q_INVOKABLE bool WindowHelper::isMaemo()
  35. {
  36. #ifdef Q_WS_MAEMO_5
  37. return true;
  38. #else
  39. return false;
  40. #endif
  41. }