Hi all

Patch to videomanager.cpp fixes a bunch of segfaults for various key-presses 
when no videos are available (happened a lot to me during initial set-up :).

Patch to metadata.cpp fixes titles (and other text fields) with double quotes 
in them getting an extra '\' saved to the db when (amongst other things) the 
parental level gets changed in the videomanager view.

These are my first patches, so let me know if they're wrong format etc.


$ cvs -z3 -d :pserver:[EMAIL PROTECTED]:/var/lib/mythcvs diff 
mythvideo/videomanager.cpp > videomanager.cpp.diff 

$ cvs -z3 -d :pserver:[EMAIL PROTECTED]:/var/lib/mythcvs diff 
mythvideo/metadata.cpp > metadata.cpp.diff

Cheers

Gareth

 

Index: mythvideo/videomanager.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/videomanager.cpp,v
retrieving revision 1.38
diff -r1.38 videomanager.cpp
1000a1001,1003
>     if ( !curitem )
>         return;
> 
1343c1346,1355
<     QButton *editButton = popup->addButton(tr("Edit Metadata"), this, SLOT(slotEditMeta()));
---
>     QButton* editButton = NULL;
> 
>     if (curitem) {
>         editButton = popup->addButton(tr("Edit Metadata"), this, SLOT(slotEditMeta()));
>         popup->addButton(tr("Search IMDB"), this, SLOT(slotAutoIMDB()));    
>         popup->addButton(tr("Manually Enter IMDB #"), this, SLOT(slotManualIMDB()));
>         popup->addButton(tr("Reset Metadata"), this, SLOT(slotResetMeta()));
>         popup->addButton(tr("Toggle Browseable"), this, SLOT(slotToggleBrowseable()));
>         popup->addButton(tr("Remove Video"), this, SLOT(slotRemoveVideo()));
>     }
1345,1350c1357
<     popup->addButton(tr("Search IMDB"), this, SLOT(slotAutoIMDB()));    
<     popup->addButton(tr("Manually Enter IMDB #"), this, SLOT(slotManualIMDB()));
<     popup->addButton(tr("Reset Metadata"), this, SLOT(slotResetMeta()));
<     popup->addButton(tr("Toggle Browseable"), this, SLOT(slotToggleBrowseable()));
<     popup->addButton(tr("Remove Video"), this, SLOT(slotRemoveVideo()));
<     popup->addButton(tr("Filter Display"), this, SLOT(slotDoFilter()));
---
>     QButton* filterButton = popup->addButton(tr("Filter Display"), this, SLOT(slotDoFilter()));
1354,1355c1361,1365
<     
<     editButton->setFocus();    
---
> 
>     if (editButton)
>         editButton->setFocus();
>     else
>         filterButton->setFocus();
1618c1628
<     if (m_state == SHOWING_MAINWINDOW)
---
>     if (m_state == SHOWING_MAINWINDOW && curitem)
1707,1708c1717,1722
<     curitem->setBrowse(!curitem->Browse());
<     curitem->updateDatabase(db);
---
>     if ( curitem )
>     {
>        curitem->setBrowse(!curitem->Browse());
>        curitem->updateDatabase(db);
>     }
> 
Index: mythvideo/metadata.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/metadata.cpp,v
retrieving revision 1.19
diff -r1.19 metadata.cpp
467,471c467,481
<     title.replace(QRegExp("\""), QString("\\\""));
<     director.replace(QRegExp("\""), QString("\\\""));
<     plot.replace(QRegExp("\""), QString("\\\""));
<     rating.replace(QRegExp("\""), QString("\\\""));
<     playcommand.replace(QRegExp("\""), QString("\\\""));
---
>     QString sqltitle = title;
>     sqltitle.replace(QRegExp("\""), QString("\\\""));
> 
>     QString sqldirector = director;
>     sqldirector.replace(QRegExp("\""), QString("\\\""));
> 
>     QString sqlplot = plot;
>     sqlplot.replace(QRegExp("\""), QString("\\\""));
>     
>     QString sqlrating = rating;
>     sqlrating.replace(QRegExp("\""), QString("\\\""));
> 
>     QString sqlplaycommand = playcommand;
>     sqlplaycommand.replace(QRegExp("\""), QString("\\\""));
> 
487,488c497,498
<                      title.utf8().data(), director.utf8().data(),
<                      plot.utf8().data(), rating.utf8().data(), year,
---
>                      sqltitle.utf8().data(), sqldirector.utf8().data(),
>                      sqlplot.utf8().data(), sqlrating.utf8().data(), year,
491c501
<                      playcommand.utf8().data(), childID, idCategory, id);
---
>                      sqlplaycommand.utf8().data(), childID, idCategory, id);
_______________________________________________
mythtv-dev mailing list
[EMAIL PROTECTED]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to