bwachter

*magit: libhybris-flash*

Nov 15th, 2013
9
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Remote: master @ origin (git@github.com:amarchen/libhybris-flash.git)
  2. Local: master ~/git/libhybris-flash/
  3. Head: 4cf8a9f Actually call c++ from qml
  4.  
  5. Changes:
  6. Modified libhybris-flash.pro
  7. diff --git a/libhybris-flash.pro b/libhybris-flash.pro
  8. index 95884b6..5681c4c 100644
  9. --- a/libhybris-flash.pro
  10. +++ b/libhybris-flash.pro
  11. @@ -9,6 +9,9 @@
  12. TARGET = libhybris-flash
  13.  
  14. CONFIG += sailfishapp
  15. +QT -= gui
  16. +
  17. +LIBS += -lcamera
  18.  
  19. SOURCES += src/libhybris-flash.cpp \
  20. src/cameratester.cpp
  21. @@ -23,4 +26,3 @@ OTHER_FILES += qml/libhybris-flash.qml \
  22.  
  23. HEADERS += \
  24. src/cameratester.h
  25. -
  26. Modified rpm/libhybris-flash.spec
  27. diff --git a/rpm/libhybris-flash.spec b/rpm/libhybris-flash.spec
  28. index 5736797..66796bf 100644
  29. --- a/rpm/libhybris-flash.spec
  30. +++ b/rpm/libhybris-flash.spec
  31. @@ -1,7 +1,7 @@
  32. -#
  33. +#
  34. # Do NOT Edit the Auto-generated Part!
  35. # Generated by: spectacle version 0.27
  36. -#
  37. +#
  38.  
  39. Name: libhybris-flash
  40.  
  41. @@ -40,7 +40,7 @@ Short description of my SailfishOS Application
  42. # >> build pre
  43. # << build pre
  44.  
  45. -%qtc_qmake5
  46. +%qtc_qmake5
  47.  
  48. %qtc_make %{?_smp_mflags}
  49.  
  50. @@ -62,11 +62,12 @@ desktop-file-install --delete-original \
  51.  
  52. %files
  53. %defattr(-,root,root,-)
  54. -/usr/share/icons/hicolor/90x90/apps
  55. +#/usr/share/icons/hicolor/90x90/apps
  56. /usr/share/applications
  57. /usr/share/libhybris-flash
  58. /usr/bin
  59. -%{_datadir}/icons/hicolor/90x90/apps/%{name}.png
  60. +#%{_datadir}/icons/hicolor/90x90/apps/%{name}.png
  61. +%{_datadir}/icons/hicolor/86x86/apps/%{name}.png
  62. %{_datadir}/applications/%{name}.desktop
  63. %{_datadir}/%{name}/qml
  64. %{_bindir}
  65. Modified src/cameratester.cpp
  66. diff --git a/src/cameratester.cpp b/src/cameratester.cpp
  67. index fd2e9ac..4819c82 100644
  68. --- a/src/cameratester.cpp
  69. +++ b/src/cameratester.cpp
  70. @@ -1,48 +1,48 @@
  71. #include "cameratester.h"
  72.  
  73. -//#include <hybris/camera/camera_compatibility_layer_capabilities.h > // for constants
  74. +#include <hybris/camera/camera_compatibility_layer_capabilities.h> // for constants
  75.  
  76. void CameraTester::connectToCamera()
  77. {
  78. emit logHappened("connecting");
  79. -// memset(&listener, 0, sizeof(m_listener)); // not sure while it's needed, but test example does this nullification
  80. -// m_cc = android_camera_connect_to(BACK_FACING_CAMERA_TYPE,
  81. -// &listener);
  82. + memset(&m_listener, 0, sizeof(m_listener)); // not sure while it's needed, but test example does this nullification
  83. + m_cc = android_camera_connect_to(BACK_FACING_CAMERA_TYPE,
  84. + &m_listener);
  85. emit logHappened("connected");
  86. }
  87.  
  88. void CameraTester::turnFlashToTorch()
  89. {
  90. emit logHappened("trying torch");
  91. -// android_camera_set_flash_mode(m_cc, FLASH_MODE_TORCH);
  92. + android_camera_set_flash_mode(m_cc, FLASH_MODE_TORCH);
  93. emit logHappened("tried torch");
  94. }
  95.  
  96. void CameraTester::turnFlashToOn()
  97. {
  98. emit logHappened("trying on");
  99. -// android_camera_set_flash_mode(m_cc, FLASH_MODE_ON);
  100. + android_camera_set_flash_mode(m_cc, FLASH_MODE_ON);
  101. emit logHappened("tried on");
  102. }
  103.  
  104. void CameraTester::startPreview()
  105. {
  106. emit logHappened("starting preview");
  107. -// android_camera_start_preview(m_cc);
  108. + android_camera_start_preview(m_cc);
  109. emit logHappened("started preview");
  110. }
  111.  
  112. void CameraTester::stopPreview()
  113. {
  114. emit logHappened("stopping preview");
  115. -// android_camera_stop_preview(m_cc);
  116. + android_camera_stop_preview(m_cc);
  117. emit logHappened("stopped preview");
  118. }
  119.  
  120. void CameraTester::disconnectCamera()
  121. {
  122. emit logHappened("disconnecting");
  123. -// android_camera_disconnect(m_cc);
  124. + android_camera_disconnect(m_cc);
  125. emit logHappened("disconnected");
  126. }
  127.  
  128. Modified src/cameratester.h
  129. diff --git a/src/cameratester.h b/src/cameratester.h
  130. index fe07fa2..a05e62e 100644
  131. --- a/src/cameratester.h
  132. +++ b/src/cameratester.h
  133. @@ -2,7 +2,7 @@
  134. #define CAMERATESTER_H
  135.  
  136. #include <QObject>
  137. -//#include <hybris/camera/camera_compatibility_layer.h >
  138. +#include <hybris/camera/camera_compatibility_layer.h>
  139.  
  140. class CameraTester : public QObject
  141. {
  142. @@ -22,8 +22,8 @@ signals:
  143. public slots:
  144.  
  145. private:
  146. -// CameraControlListener m_listener;
  147. -// CameraControl* m_cc;
  148. + CameraControlListener m_listener;
  149. + CameraControl* m_cc;
  150.  
  151. };
  152.  
  153. Modified src/libhybris-flash.cpp
  154. diff --git a/src/libhybris-flash.cpp b/src/libhybris-flash.cpp
  155. index 0c3220e..776ed1a 100644
  156. --- a/src/libhybris-flash.cpp
  157. +++ b/src/libhybris-flash.cpp
  158. @@ -28,9 +28,9 @@
  159. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  160. */
  161.  
  162. -#ifdef QT_QML_DEBUG
  163. +//#ifdef QT_QML_DEBUG
  164. #include <QtQuick>
  165. -#endif
  166. +//#endif
  167.  
  168. #include <sailfishapp.h>
  169. #include "cameratester.h"
  170. @@ -48,4 +48,3 @@ int main(int argc, char *argv[])
  171. view->showFullScreen();
  172. return app->exec();
  173. }
  174. -
RAW Paste Data