~ubuntu-branches/debian/squeeze/smplayer/squeeze

« back to all changes in this revision

Viewing changes to src/server.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Breuil Cyril
  • Date: 2007-06-24 16:35:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070624163529-hhckbmd24uicada7
Tags: 0.5.20-0ubuntu1
* New upstream release
* Change Maintainer Email

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
void ClientSocket::readClient() {
45
45
        QRegExp rx_open("^open (.*)");
46
46
        QRegExp rx_open_utf8("^open_utf8 (.*)");
 
47
        QRegExp rx_open_files("^open_files (.*)");
47
48
        QRegExp rx_function("^(function|f) (.*)");
48
49
 
49
50
        QTextStream ts( this );
86
87
                                sendText( l[n] );
87
88
                        }
88
89
                        */
89
 
                        sendText("None");
 
90
                        for (int n=0; n < actions_list.count(); n++) {
 
91
                                sendText( actions_list[n] );
 
92
                        }
 
93
                        /*sendText("None");*/
90
94
                }
91
95
                else 
92
96
                if (rx_open.search(str) > -1) {
103
107
                        sendText("OK, file sent to GUI");
104
108
                } 
105
109
                else
 
110
                if (str.lower() == "open_files_start") {
 
111
                        files_to_open.clear();
 
112
                        sendText("OK, send first file");
 
113
                }
 
114
                else
 
115
                if (str.lower() == "open_files_end") {
 
116
                        qDebug("ClientSocket::readClient: files_to_open:");
 
117
                        for (int n=0; n < files_to_open.count(); n++) 
 
118
                                qDebug("%d: '%s'", n, files_to_open[n].utf8().data());
 
119
                        sendText("OK, sending files to GUI");
 
120
                        emit receivedOpenFiles(files_to_open);
 
121
                }
 
122
                else
 
123
                if (rx_open_files.search(str) > -1) {
 
124
                        QString file = rx_open_files.cap(1);
 
125
                        files_to_open.append(file);
 
126
                        sendText("OK, file received");
 
127
                }
 
128
                else
106
129
                if (rx_function.search(str) > -1) {
107
 
                        QString function = rx_function.cap(2).upper();
 
130
                        QString function = rx_function.cap(2).lower(); //upper();
108
131
                        qDebug("ClientSocket::readClient: asked to process function '%s'", function.utf8().data());
109
132
                        emit receivedFunction(function);
110
133
                        sendText("OK, function sent to GUI");
139
162
 
140
163
void MyServer::newConnection( int socket ) {
141
164
        ClientSocket *s = new ClientSocket( socket, this, "socket" );
 
165
        s->setActionsList( actions_list );
142
166
 
143
167
        connect(s, SIGNAL(receivedOpen(QString)), 
144
168
            this, SIGNAL(receivedOpen(QString)));
 
169
        connect(s, SIGNAL(receivedOpenFiles(QStringList)), 
 
170
            this, SIGNAL(receivedOpenFiles(QStringList)));
145
171
        connect(s, SIGNAL(receivedFunction(QString)),
146
172
            this, SIGNAL(receivedFunction(QString)));
147
173