mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-08-02 17:09:28 +02:00
2015-01-09 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'rdlogmanager/editschedrules.cpp' and 'rdlogmanager/editschedrules.h' that caused scheduling rule data to be corrupt if the rules list was resorted [GitHub issue #000054].
This commit is contained in:
parent
c7c9094842
commit
ad53400250
@ -14701,3 +14701,7 @@
|
|||||||
2015-01-07 Fred Gleason <fredg@paravelsystems.com>
|
2015-01-07 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Added an 'RDReport::MrMaster' value to the 'RDReport::ExportFilter
|
* Added an 'RDReport::MrMaster' value to the 'RDReport::ExportFilter
|
||||||
enumeration in 'lib/rdreport.cpp' and 'lib/rdreport.h'.
|
enumeration in 'lib/rdreport.cpp' and 'lib/rdreport.h'.
|
||||||
|
2015-01-09 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Fixed a bug in 'rdlogmanager/editschedrules.cpp' and
|
||||||
|
'rdlogmanager/editschedrules.h' that caused scheduling rule data
|
||||||
|
to be corrupt if the rules list was resorted [GitHub issue #000054].
|
||||||
|
@ -37,12 +37,7 @@ SchedRulesList::SchedRulesList(QString clockname)
|
|||||||
NOT_AFTER varchar(10),\
|
NOT_AFTER varchar(10),\
|
||||||
OR_AFTER varchar(10),\
|
OR_AFTER varchar(10),\
|
||||||
OR_AFTER_II varchar(10))",(const char*)clockname.replace(" ","_"));
|
OR_AFTER_II varchar(10))",(const char*)clockname.replace(" ","_"));
|
||||||
|
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
if(!q->isActive()) {
|
|
||||||
printf("SQL: %s\n",(const char *)sql);
|
|
||||||
printf("SQL Error: %s\n",(const char *)q->lastError().databaseText());
|
|
||||||
}
|
|
||||||
delete q;
|
delete q;
|
||||||
|
|
||||||
sql=QString().sprintf("select CODE,DESCRIPTION from SCHED_CODES order by `CODE` asc");
|
sql=QString().sprintf("select CODE,DESCRIPTION from SCHED_CODES order by `CODE` asc");
|
||||||
|
@ -402,7 +402,9 @@ void EditClock::schedRules()
|
|||||||
QString clock_name = edit_clock->name();
|
QString clock_name = edit_clock->name();
|
||||||
bool rules_modified = edit_clock->getRulesModified();
|
bool rules_modified = edit_clock->getRulesModified();
|
||||||
|
|
||||||
EditSchedRules *dialog=new EditSchedRules(clock_name,&edit_artistsep,sched_rules_list,&rules_modified,this,"dialog");
|
EditSchedRules *dialog=
|
||||||
|
new EditSchedRules(clock_name,&edit_artistsep,sched_rules_list,
|
||||||
|
&rules_modified,this);
|
||||||
dialog->exec();
|
dialog->exec();
|
||||||
|
|
||||||
if (edit_clock->getArtistSep()!=edit_artistsep)
|
if (edit_clock->getArtistSep()!=edit_artistsep)
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
//
|
//
|
||||||
// Stefan Gabriel <stg@st-gabriel.de>
|
// Stefan Gabriel <stg@st-gabriel.de>
|
||||||
//
|
//
|
||||||
//
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License version 2 as
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
// published by the Free Software Foundation.
|
// published by the Free Software Foundation.
|
||||||
@ -31,22 +29,22 @@
|
|||||||
|
|
||||||
#include <rd.h>
|
#include <rd.h>
|
||||||
#include <rddb.h>
|
#include <rddb.h>
|
||||||
|
#include <rdlistviewitem.h>
|
||||||
|
|
||||||
#include <edit_schedrules.h>
|
#include <edit_schedrules.h>
|
||||||
#include <edit_schedcoderules.h>
|
#include <edit_schedcoderules.h>
|
||||||
#include <schedruleslist.h>
|
#include <schedruleslist.h>
|
||||||
#include <list_clocks.h>
|
#include <list_clocks.h>
|
||||||
|
|
||||||
|
|
||||||
EditSchedRules::EditSchedRules(QString clock,unsigned *artistsep,SchedRulesList *schedruleslist,bool *rules_modified,QWidget *parent,const char *name)
|
EditSchedRules::EditSchedRules(QString clock,unsigned *artistsep,SchedRulesList *schedruleslist,bool *rules_modified,QWidget *parent)
|
||||||
: QDialog(parent,name,true)
|
: QDialog(parent,"",true)
|
||||||
{
|
{
|
||||||
edit_artistsep=artistsep;
|
edit_artistsep=artistsep;
|
||||||
edit_rules_modified=rules_modified;
|
edit_rules_modified=rules_modified;
|
||||||
sched_rules_list = schedruleslist;
|
sched_rules_list = schedruleslist;
|
||||||
clockname = clock;
|
clockname = clock;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fix the Window Size
|
// Fix the Window Size
|
||||||
//
|
//
|
||||||
@ -113,7 +111,7 @@ EditSchedRules::EditSchedRules(QString clock,unsigned *artistsep,SchedRulesList
|
|||||||
|
|
||||||
|
|
||||||
// List
|
// List
|
||||||
list_schedCodes_view=new QListView(this,"list_schedCodes_view");
|
list_schedCodes_view=new RDListView(this,"list_schedCodes_view");
|
||||||
list_schedCodes_view->setGeometry(10,60,size().width()-20,size().height()-140);
|
list_schedCodes_view->setGeometry(10,60,size().width()-20,size().height()-140);
|
||||||
list_schedCodes_view->setAllColumnsShowFocus(true);
|
list_schedCodes_view->setAllColumnsShowFocus(true);
|
||||||
list_schedCodes_view->addColumn(tr("CODE"));
|
list_schedCodes_view->addColumn(tr("CODE"));
|
||||||
@ -156,12 +154,12 @@ QSizePolicy EditSchedRules::sizePolicy() const
|
|||||||
void EditSchedRules::Load()
|
void EditSchedRules::Load()
|
||||||
{
|
{
|
||||||
QString str;
|
QString str;
|
||||||
QListViewItem *item;
|
RDListViewItem *item;
|
||||||
|
|
||||||
list_schedCodes_view->clear();
|
list_schedCodes_view->clear();
|
||||||
for (int i=0; i<sched_rules_list->getNumberOfItems(); i++)
|
for (int i=0; i<sched_rules_list->getNumberOfItems(); i++) {
|
||||||
{
|
item=new RDListViewItem(list_schedCodes_view);
|
||||||
item=new QListViewItem(list_schedCodes_view);
|
item->setId(i);
|
||||||
item->setText(0,sched_rules_list->getItemSchedCode(i));
|
item->setText(0,sched_rules_list->getItemSchedCode(i));
|
||||||
str=QString().sprintf("%d",sched_rules_list->getItemMaxRow(i));
|
str=QString().sprintf("%d",sched_rules_list->getItemMaxRow(i));
|
||||||
item->setText(1,str);
|
item->setText(1,str);
|
||||||
@ -171,31 +169,28 @@ void EditSchedRules::Load()
|
|||||||
item->setText(4,sched_rules_list->getItemOrAfter(i));
|
item->setText(4,sched_rules_list->getItemOrAfter(i));
|
||||||
item->setText(5,sched_rules_list->getItemOrAfterII(i));
|
item->setText(5,sched_rules_list->getItemOrAfterII(i));
|
||||||
item->setText(6,sched_rules_list->getItemDescription(i));
|
item->setText(6,sched_rules_list->getItemDescription(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EditSchedRules::Close()
|
void EditSchedRules::Close()
|
||||||
{
|
{
|
||||||
QListViewItem *item;
|
RDListViewItem *item=(RDListViewItem *)list_schedCodes_view->firstChild();
|
||||||
int number_of_items;
|
|
||||||
|
|
||||||
number_of_items = list_schedCodes_view->childCount();
|
|
||||||
|
|
||||||
*edit_rules_modified=true;
|
*edit_rules_modified=true;
|
||||||
|
|
||||||
for (int i=0; i< number_of_items; i++)
|
while(item!=NULL) {
|
||||||
{
|
sched_rules_list->
|
||||||
item=list_schedCodes_view->firstChild();
|
insertItem(item->id(),item->text(1).toInt(),item->text(2).toInt(),
|
||||||
sched_rules_list->insertItem(i,item->text(1).toInt(),item->text(2).toInt(),item->text(3),item->text(4),item->text(5));
|
item->text(3),item->text(4),item->text(5));
|
||||||
list_schedCodes_view->takeItem(item);
|
item=(RDListViewItem *)item->nextSibling();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EditSchedRules::editData()
|
void EditSchedRules::editData()
|
||||||
{
|
{
|
||||||
QListViewItem *item=list_schedCodes_view->selectedItem();
|
RDListViewItem *item=(RDListViewItem *)list_schedCodes_view->selectedItem();
|
||||||
if(item==NULL) {
|
if(item==NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -213,7 +208,7 @@ void EditSchedRules::importData()
|
|||||||
{
|
{
|
||||||
QString clockname = "";
|
QString clockname = "";
|
||||||
QString str;
|
QString str;
|
||||||
QListViewItem *item;
|
RDListViewItem *item;
|
||||||
QString sql;
|
QString sql;
|
||||||
RDSqlQuery *q;
|
RDSqlQuery *q;
|
||||||
|
|
||||||
@ -229,7 +224,8 @@ void EditSchedRules::importData()
|
|||||||
list_schedCodes_view->clear();
|
list_schedCodes_view->clear();
|
||||||
for (int i=0; i<import_list->getNumberOfItems(); i++)
|
for (int i=0; i<import_list->getNumberOfItems(); i++)
|
||||||
{
|
{
|
||||||
item=new QListViewItem(list_schedCodes_view);
|
item=new RDListViewItem(list_schedCodes_view);
|
||||||
|
item->setId(i);
|
||||||
item->setText(0,import_list->getItemSchedCode(i));
|
item->setText(0,import_list->getItemSchedCode(i));
|
||||||
str=QString().sprintf("%d",import_list->getItemMaxRow(i));
|
str=QString().sprintf("%d",import_list->getItemMaxRow(i));
|
||||||
item->setText(1,str);
|
item->setText(1,str);
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
#include <qlistview.h>
|
#include <qlistview.h>
|
||||||
#include <qvariant.h>
|
#include <qvariant.h>
|
||||||
|
|
||||||
|
#include <rdlistview.h>
|
||||||
|
|
||||||
#include <schedruleslist.h>
|
#include <schedruleslist.h>
|
||||||
|
|
||||||
class QSpinBox;
|
class QSpinBox;
|
||||||
@ -38,7 +40,9 @@ class EditSchedRules : public QDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EditSchedRules(QString clock,unsigned *artistsep,SchedRulesList *schedruleslist,bool *rules_modified,QWidget *parent=0,const char *name=0);
|
EditSchedRules(QString clock,unsigned *artistsep,
|
||||||
|
SchedRulesList *schedruleslist,bool *rules_modified,
|
||||||
|
QWidget *parent=0);
|
||||||
~EditSchedRules();
|
~EditSchedRules();
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
QSizePolicy sizePolicy() const;
|
QSizePolicy sizePolicy() const;
|
||||||
@ -58,7 +62,7 @@ class EditSchedRules : public QDialog
|
|||||||
void Close();
|
void Close();
|
||||||
QLabel* artistSepLabel;
|
QLabel* artistSepLabel;
|
||||||
QSpinBox* artistSepSpinBox;
|
QSpinBox* artistSepSpinBox;
|
||||||
QListView *list_schedCodes_view;
|
RDListView *list_schedCodes_view;
|
||||||
QString clockname;
|
QString clockname;
|
||||||
unsigned* edit_artistsep;
|
unsigned* edit_artistsep;
|
||||||
bool* edit_rules_modified;
|
bool* edit_rules_modified;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user