diff options
| author | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-10-26 21:01:56 +0000 |
|---|---|---|
| committer | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-10-26 21:01:56 +0000 |
| commit | fb3cae2da67d2e12d676997af9b59eb72ab5c6ac (patch) | |
| tree | 3a27218116416bfb73b0febfd2216f718b4a5c69 | |
| parent | 08135daabe8390c0356f92a9b789b3ce834c088e (diff) | |
| download | vdr-plugin-muggle-fb3cae2da67d2e12d676997af9b59eb72ab5c6ac.tar.gz vdr-plugin-muggle-fb3cae2da67d2e12d676997af9b59eb72ab5c6ac.tar.bz2 | |
Removed compiler errors
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@251 e10066b5-e1e2-0310-b819-94efdf66514b
| -rw-r--r-- | gd_content_interface.c | 12 | ||||
| -rw-r--r-- | muggle.c | 1 | ||||
| -rw-r--r-- | muggle.h | 1 | ||||
| -rw-r--r-- | vdr_menu.c | 18 | ||||
| -rw-r--r-- | vdr_menu.h | 2 |
5 files changed, 21 insertions, 13 deletions
diff --git a/gd_content_interface.c b/gd_content_interface.c index 987bd70..a7d5bac 100644 --- a/gd_content_interface.c +++ b/gd_content_interface.c @@ -767,26 +767,27 @@ bool GdPlaylist::storePlaylist() bool GdPlaylist::storeAs( std::string name ) { int id; - + MYSQL_ROW row; + MYSQL_RES *result; + result = mgSqlReadQuery( &m_db, "SELECT id FROM playlist WHERE title=\"current\"" ); if( mysql_num_rows(result) ) { - MYSQL row = mysql_fetch_row( result ); + row = mysql_fetch_row( result ); } else { // otherwise create a new database entry mgSqlWriteQuery( &m_db, "INSERT into playlist SET " "title=\"%s\", author=\"VDR\"", - name.c_str() ) + name.c_str() ); // now read the new list to get the id result = mgSqlReadQuery( &m_db, "SELECT id,author FROM playlist where title=\"current\""); - nrows = mysql_num_rows(result); row = mysql_fetch_row(result); } @@ -804,6 +805,8 @@ bool GdPlaylist::storeAs( std::string name ) id ); // add new playlist items to db + std::vector<mgContentItem*>::iterator iter; + int num = 0; for( iter=m_list.begin(), num=0; iter != m_list.end(); iter++, num++) @@ -814,6 +817,7 @@ bool GdPlaylist::storeAs( std::string name ) num, (*iter)->getId(), m_sqlId); } } + return true; } /*! @@ -15,6 +15,7 @@ #include "vdr_menu.h" #include "vdr_setup.h" #include "mg_tools.h" +#include "mg_playlist.h" #include "mg_content_interface.h" #include "mg_media.h" @@ -11,7 +11,6 @@ * $Id$ */ - // Some notes about the general structure of the plugin /* \defgroup giantdisc GiantDisc integration layer @@ -14,7 +14,10 @@ #include <string> #include <vector> +// #include <cstring> + #include <mysql/mysql.h> + #include <menuitems.h> #include <tools.h> #include <config.h> @@ -73,9 +76,9 @@ mgMainMenu::mgMainMenu(mgMedia *media, mgSelectionTreeNode *root, DisplayTree( m_root ); - strncpy( m_listname, playlist->getListname(), 31 ); - m_listname[31] = "\0"; - m_editing_listname + strncpy( m_listname, playlist->getListname().c_str(), 31 ); + m_listname[31] = '\0'; + m_editing_listname = false; } mgSelectionTreeNode *mgMainMenu::CurrentNode() @@ -395,10 +398,11 @@ eOSState mgMainMenu::ProcessKey(eKeys key) } else { // editing playlist name - s_editing_listname = !s_editing_listname; - if( s_editing_listname = false ) + m_editing_listname = !m_editing_listname; + if( m_editing_listname = false ) { // we just changed from true to false so editing was terminated - m_playlist->setListname( s_listname ); + RenamePlaylist( std::string( m_listname ) ); + } } } break; @@ -700,7 +704,7 @@ void mgMainMenu::DisplayPlaylistSubmenu() SetTitle( "Muggle - Playlist View Commands" ); // Add items - Add( new cMenuEditStrItem( tr("Playlist name"), s_listname, 32, allowed ) ); + Add( new cMenuEditStrItem( tr("Playlist name"), m_listname, 31, allowed ) ); Add( new cOsdItem( tr("Load playlist" ) ) ); Add( new cOsdItem( tr("Save playlist" ) ) ); Add( new cOsdItem( tr("Clear playlist" ) ) ); @@ -87,7 +87,7 @@ class mgMainMenu : public cOsdMenu void LoadPlaylist(); void SavePlaylist(); - void RenamePlaylist(); + void RenamePlaylist( std::string name ); void DisplayPlaylistSubmenu(); eOSState PlaylistSubmenuAction( int n ); void DisplayPlaylistCommands(); |
