commit imagewriter for openSUSE:Factory
Hello community, here is the log from the commit of package imagewriter for openSUSE:Factory checked in at Sun Mar 21 18:37:25 CET 2010. -------- --- imagewriter/imagewriter.changes 2010-03-09 17:26:11.000000000 +0100 +++ /mounts/work_src_done/STABLE/imagewriter/imagewriter.changes 2010-03-21 15:56:23.000000000 +0100 @@ -1,0 +2,7 @@ +Sun Mar 21 14:52:51 UTC 2010 - mbarringer@novell.com + +- Fixing bug 589463 - Imagewriter should display information in the USB dropdown + - Dropdown now tells the user to insert a device, rather than + show an empty menu. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- imagewriter-1.7.tar.gz New: ---- imagewriter-1.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ imagewriter.spec ++++++ --- /var/tmp/diff_new_pack.wmXynQ/_old 2010-03-21 18:37:06.000000000 +0100 +++ /var/tmp/diff_new_pack.wmXynQ/_new 2010-03-21 18:37:06.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package imagewriter (Version 1.7) +# spec file for package imagewriter (Version 1.8) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -40,7 +40,7 @@ %endif Summary: SUSE Studio Imagewriter -Version: 1.7 +Version: 1.8 Release: 1 Group: Hardware/Other License: GPLv2 ++++++ imagewriter-1.7.tar.gz -> imagewriter-1.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagewriter-1.7/.make new/imagewriter-1.8/.make --- old/imagewriter-1.7/.make 1970-01-01 01:00:00.000000000 +0100 +++ new/imagewriter-1.8/.make 2010-03-21 15:38:49.000000000 +0100 @@ -0,0 +1,14 @@ +#!/bin/sh +# Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. All rights reserved. +# +# Author: Matt Barringer <mbaringer@novell.com>, 2008 +# Status: Up-to-date +# +if [ -d /usr/share/qt/mkspecs/linux-g++ ];then + export QMAKESPEC=/usr/share/qt/mkspecs/linux-g++/ + `which qmake` -makefile -unix -o Makefile imagewriter.pro +else + export QMAKESPEC=/usr/share/qt4/mkspecs/linux-g++/ + `which qmake` -makefile -unix -o Makefile imagewriter.pro +fi + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagewriter-1.7/ImageReader.cpp new/imagewriter-1.8/ImageReader.cpp --- old/imagewriter-1.7/ImageReader.cpp 2010-03-09 17:15:00.000000000 +0100 +++ new/imagewriter-1.8/ImageReader.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,91 +0,0 @@ -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <errno.h> - -#include <QtCore> -#include <QMessageBox> -#include "ImageReader.h" - - -ImageReader::ImageReader() -{ -} - -bool -ImageReader::Open(const QString &fileName, char *buffer, size_t count) -{ - pBuffer = buffer; - mCount = count; - - if ((mFd = ::open(fileName.toLocal8Bit().data(), O_RDONLY|O_LARGEFILE)) == -1) - { - QMessageBox msgBox; - msgBox.setText(QObject::tr("Couldn't open ") + fileName + ": " + strerror(errno)); - msgBox.exec(); - return false; - } - - return true; -} - -size_t -ImageReader::Read() -{ - return ::read(mFd, pBuffer, mCount); -} - -void -ImageReader::Close() -{ - ::close(mFd); -} - -BzipReader::BzipReader() -{ -} - -bool -BzipReader::Open(const QString &fileName, char *buffer, size_t count) -{ - int error; - if (!ImageReader::Open(fileName, buffer, count)) - return false; - - pFile = ::fdopen(mFd, "r"); - if (pFile == NULL) - return false; - - pBzFile = BZ2_bzReadOpen (&error, pFile, 0, 0, NULL, 0); - if (error != BZ_OK) - { - fclose(pFile); - return false; - } - - return true; -} - -size_t -BzipReader::Read() -{ - int error; - int read; - read = BZ2_bzRead(&error, pBzFile, pBuffer, mCount); - if (error != BZ_OK && error != BZ_STREAM_END) - { - BZ2_bzReadClose(NULL, pBzFile); - throw READ_ERROR; - } - - return read; -} - -void -BzipReader::Close() -{ - BZ2_bzReadClose(NULL, pBzFile); - fclose(pFile); - ::close(mFd); -} - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagewriter-1.7/ImageReader.h new/imagewriter-1.8/ImageReader.h --- old/imagewriter-1.7/ImageReader.h 2010-03-09 17:15:00.000000000 +0100 +++ new/imagewriter-1.8/ImageReader.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,39 +0,0 @@ -#ifndef IMAGEREADER_H -#define IMAGEREADER_H - -#include <stdlib.h> -#include <stdio.h> -#include <bzlib.h> - -#include <QtCore> - -class ImageReader -{ -public: - ImageReader(); - bool Open(const QString &fileName, char *buffer, size_t count); - size_t Read(); - void Close(); - -protected: - int mFd; - char *pBuffer; - size_t mCount; -}; - -class BzipReader : public ImageReader -{ -public: - BzipReader(); - bool Open(const QString &fileName, char *buffer, size_t count); - size_t Read(); - void Close(); - -private: - FILE *pFile; - BZFILE *pBzFile; -}; - -// TODO Tar & Gzip readers - -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagewriter-1.7/MainWindow.cpp new/imagewriter-1.8/MainWindow.cpp --- old/imagewriter-1.7/MainWindow.cpp 2010-03-09 17:15:00.000000000 +0100 +++ new/imagewriter-1.8/MainWindow.cpp 2010-03-21 15:38:49.000000000 +0100 @@ -100,7 +100,7 @@ { if (!(*i)->getPath().isEmpty()) if (deviceComboBox->findText((*i)->getDisplayString()) == -1) - deviceComboBox->addItem((*i)->getDisplayString(), 0); + addMenuItem((*i)->getDisplayString()); if (cmddevice != NULL) if ((*i)->getPath().compare(cmddevice) == 0) @@ -139,7 +139,7 @@ directive->setText(tr("Drag disk image here\n or click to select.")); directive->setAlignment(Qt::AlignCenter); deviceComboBox = new QComboBox; - + deviceComboBox->addItem(DROPDOWN_DIRECTIVE); writeButton = new QPushButton(tr("Write")); connect(writeButton, SIGNAL(clicked()), this, SLOT(write())); @@ -307,7 +307,7 @@ DeviceItem *device = pPlatform->getNewDevice(devicePath); if (device != NULL) if (deviceComboBox->findText(device->getDisplayString()) == -1) - deviceComboBox->addItem(device->getDisplayString(), 0); + addMenuItem(device->getDisplayString()); } } @@ -324,10 +324,8 @@ { if ((*i)->getUDI() == devicePath) { - index = deviceComboBox->findText((*i)->getDisplayString()); - if (index != -1) + if (removeMenuItem((*i)->getDisplayString()) != -1) { - deviceComboBox->removeItem(index); pPlatform->removeDeviceFromList(devicePath); break; } @@ -337,6 +335,27 @@ } void +MainWindow::addMenuItem(const QString &item) +{ + if (deviceComboBox->itemText(0) == DROPDOWN_DIRECTIVE) + deviceComboBox->removeItem(0); + deviceComboBox->addItem(item, 0); +} + +int +MainWindow::removeMenuItem(const QString &item) +{ + int index = deviceComboBox->findText(item); + if (index != -1) + { + deviceComboBox->removeItem(index); + if (deviceComboBox->count() == 0) + deviceComboBox->addItem(DROPDOWN_DIRECTIVE); + } + return(index); +} + +void MainWindow::setSizeLabel(const QString &fileName) { if (fileName != "") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagewriter-1.7/MainWindow.h new/imagewriter-1.8/MainWindow.h --- old/imagewriter-1.7/MainWindow.h 2010-03-09 17:15:00.000000000 +0100 +++ new/imagewriter-1.8/MainWindow.h 2010-03-21 15:38:49.000000000 +0100 @@ -30,7 +30,8 @@ #include "Platform.h" #include "DeviceItem.h" -#define VERSION "SUSE Studio Image Writer 1.7" +#define VERSION "SUSE Studio Image Writer 1.8" +#define DROPDOWN_DIRECTIVE "Insert a USB device" class MainWindow : public QWidget { @@ -58,6 +59,8 @@ void setSizeLabel(const QString &fileName); private: + void addMenuItem(const QString &item); + int removeMenuItem(const QString &item); void setFile(const QString &newFile); void divineMeaning(const QString &path); void divineFurther(DeviceItem *item); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagewriter-1.7/imagewriter.desktop new/imagewriter-1.8/imagewriter.desktop --- old/imagewriter-1.7/imagewriter.desktop 2010-03-09 17:15:00.000000000 +0100 +++ new/imagewriter-1.8/imagewriter.desktop 2010-03-21 15:47:10.000000000 +0100 @@ -7,5 +7,4 @@ Name=SUSE Studio Imagewriter GenericName=USB key writer X-KDE-SubstituteUID=true -Version=1.6 -Type=Application +Version=1.0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de