Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed gallery icon bug

  • Loading branch information...
commit 6150c4962fd9edaada03d8c632bb869ca071a15e 1 parent 2ed62e4
Michael Demetriou authored
View
3  CameraParameters.cpp
@@ -154,4 +154,7 @@ void CameraParameters::setBackCurtain(bool enabled){
void CameraParameters::openLastPicture(){
QDesktopServices::openUrl(QUrl("file://"+this->lastPicture));
}
+void CameraParameters::setLastPicture(QString lastPic){
+ this->lastPicture = lastPic;
+}
View
1  CameraParameters.h
@@ -111,6 +111,7 @@ public slots:
void setBackCurtain(bool);
void openLastPicture();
+ void setLastPicture(QString);
signals:
// A signal signifying that the camera parameters have changed.
View
16 CameraThread.cpp
@@ -8,6 +8,8 @@
#include <vector>
#include <iostream>
+#include <QQueue>
+#include <qmath.h>
#include "OverlayWidget.h"
#include "CameraParameters.h"
@@ -44,7 +46,6 @@ void CameraThread::run() {
return;
}
-
// Action (Flash)
FCam::Flash::FireAction fire(&flash);
@@ -73,7 +74,7 @@ void CameraThread::run() {
FCam::Shot photo;
photo.image = FCam::Image(sensor.maxImageSize(), FCam::RAW, FCam::Image::AutoAllocate);
-
+ QQueue<QString> pictureNames;
// LEDBlinker blinker;
// LEDBlinker::BlinkAction blink(&blinker);
@@ -124,7 +125,10 @@ void CameraThread::run() {
// Drain the queue
FCam::Frame f;
do {
- f = sensor.getFrame();
+ f = sensor.getFrame();
+ // filewriter doesn't emit a signal when it finishes saving a file so we use a hackish way;
+ //qDebug()<< "before dequeure" << pictureNames;
+ if (!pictureNames.isEmpty() && pictureNames.length()*2 > writer.savesPending()) emit pictureSaved(QString(pictureNames.dequeue()));
if (f.shot().id == photo.id) {
// Our photo came back, asynchronously save it to disk
@@ -138,13 +142,15 @@ void CameraThread::run() {
printf("Got a full-res frame\n");
}
+
char fname[256];
// Save it as a JPEG
snprintf(fname, 255, "%s/MyDocs/DCIM/photo_%s.jpg", getenv("HOME"),
f.exposureStartTime().toString().c_str());
writer.saveJPEG(f, fname, 90);
- parameters->lastPicture = fname;
- emit pictureSaved(QString(fname));
+ // filewriter doesn't emit a signal when it finishes saving a file so we use a hackish way;
+ pictureNames.enqueue(QString(fname));
+ //qDebug()<< "after enqueue" << pictureNames;
// Save it as a DNG
snprintf(fname, 255, "%s/MyDocs/DCIM/photo_%s.dng", getenv("HOME"),
View
2  Makefile
@@ -1,2 +1,2 @@
-clean:
+-e clean:
echo clean
View
2  generate-obs-source
@@ -1,6 +1,6 @@
#!/bin/sh
-SDK_DIR=`echo ~/QtSDK`
+SDK_DIR=`echo /opt/QtSDK`
MADDE_DIR="${SDK_DIR}/Madde"
MAD="${MADDE_DIR}/bin/mad"
TARGET="harmattan_10.2011.34-1_rt1.2"
View
5 qtc_packaging/debian_harmattan/changelog
@@ -1,3 +1,8 @@
+rawcam (0.0.5) unstable; urgency=low
+ * <Add change description here>
+
+ -- Michael Demetriou <qwazix@unknown> Tue, 31 Jul 2012 17:18:49 +0300
+
rawcam (0.0.4) unstable; urgency=low
* Full manual controls: Auto, Shutter priority, ISO priority, Manual
* Fixed the flashing under electric lighting bug
View
8 rawcam.cpp
@@ -82,7 +82,7 @@ int main(int argc, char **argv) {
// gallery button
QPushButton* gallery = new QPushButton("", window);
- gallery->move(780, 55);
+ gallery->move(780, 60);
gallery->setObjectName("gallery");
gallery->hide();
@@ -92,10 +92,6 @@ int main(int argc, char **argv) {
shutter->move(750,200);
shutter->setObjectName("shutter");
QObject::connect(shutter, SIGNAL(released()), cameraThread, SLOT(snapshot()));
- QObject::connect(cameraThread, SIGNAL(pictureSaved(QString)), gallery, SLOT(show()));
-
-
-
// t->setStyleSheet("min-height: 100px;"
// "border-style: outset;"
@@ -128,6 +124,8 @@ int main(int argc, char **argv) {
CameraParameters* params = cameraThread->parameters;
+ QObject::connect(cameraThread, SIGNAL(pictureSaved(QString)), gallery, SLOT(show()));
+ QObject::connect(cameraThread, SIGNAL(pictureSaved(QString)), params, SLOT(setLastPicture(QString)));
QObject::connect(gallery,SIGNAL(clicked()), params, SLOT(openLastPicture()));
// flash control
Please sign in to comment.
Something went wrong with that request. Please try again.