mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
[#1886] No more compile warnings. + 1 comm
This commit is contained in:
@ -127,7 +127,7 @@ bool AccountListModel::addAccount( QString alias )
|
||||
return true;
|
||||
}
|
||||
|
||||
int AccountListModel::rowCount(const QModelIndex & parent) const
|
||||
int AccountListModel::rowCount(const QModelIndex & /*parent*/) const
|
||||
{
|
||||
return accounts->size();
|
||||
}
|
||||
|
@ -56,13 +56,13 @@
|
||||
***************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
char success;
|
||||
char reason[200];
|
||||
char user[200];
|
||||
char passwd[200];
|
||||
bool success;
|
||||
QString reason;
|
||||
QString user;
|
||||
QString passwd;
|
||||
} rest_account;
|
||||
|
||||
int req(char *host, int port, char *req, char *ret) {
|
||||
int sendRequest(QString host, int port, QString req, QString & ret) {
|
||||
|
||||
int s;
|
||||
struct sockaddr_in servSockAddr;
|
||||
@ -74,9 +74,9 @@ int req(char *host, int port, char *req, char *ret) {
|
||||
char buf[1024];
|
||||
|
||||
bzero(&servSockAddr, sizeof(servSockAddr));
|
||||
servHostEnt = gethostbyname(host);
|
||||
servHostEnt = gethostbyname(host.toLatin1());
|
||||
if (servHostEnt == NULL) {
|
||||
strcpy(ret, "gethostbyname");
|
||||
ret = "gethostbyname";
|
||||
return -1;
|
||||
}
|
||||
bcopy((char *)servHostEnt->h_addr, (char *)&servSockAddr.sin_addr, servHostEnt->h_length);
|
||||
@ -84,20 +84,22 @@ int req(char *host, int port, char *req, char *ret) {
|
||||
servSockAddr.sin_family = AF_INET;
|
||||
|
||||
if ((s = socket(AF_INET,SOCK_STREAM,0)) < 0) {
|
||||
strcpy(ret, "socket");
|
||||
ret = "socket";
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(connect(s, (const struct sockaddr *) &servSockAddr, (socklen_t) sizeof(servSockAddr)) < 0 ) {
|
||||
perror("foo");
|
||||
strcpy(ret, "connect");
|
||||
perror(NULL);
|
||||
ret = "connect";
|
||||
return -1;
|
||||
}
|
||||
|
||||
f = fdopen(s, "r+");
|
||||
|
||||
fprintf(f, "%s HTTP/1.1\r\n", req);
|
||||
fprintf(f, "Host: %s\r\n", host);
|
||||
const char * req2 = req.toLatin1();
|
||||
const char * host2 = host.toLatin1();
|
||||
fprintf(f, "%s HTTP/1.1\r\n", req2);
|
||||
fprintf(f, "Host: %s\r\n", host2);
|
||||
fputs("User-Agent: SFLphone\r\n", f);
|
||||
fputs("\r\n", f);
|
||||
|
||||
@ -113,7 +115,8 @@ int req(char *host, int port, char *req, char *ret) {
|
||||
ret[i] = fgetc(f);
|
||||
|
||||
if (status != 200) {
|
||||
sprintf(ret, "http error: %ld", status);
|
||||
ret = "http error: " + status;
|
||||
// sprintf(ret, "http error: %ld", status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -123,22 +126,22 @@ int req(char *host, int port, char *req, char *ret) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
rest_account get_rest_account(char *host,char *email) {
|
||||
char ret[4096];
|
||||
rest_account get_rest_account(QString host, QString email) {
|
||||
QString req = "GET /rest/accountcreator?email=" + email;
|
||||
QString ret;
|
||||
rest_account ra;
|
||||
bzero(ret, sizeof(ret));
|
||||
printf("HOST: %s\n", host);
|
||||
strcpy(ret,"GET /rest/accountcreator?email=");
|
||||
strcat(ret, email);
|
||||
if (req(host, 80, ret, ret) != -1) {
|
||||
strcpy(ra.user, strtok(ret, "\n"));
|
||||
strcpy(ra.passwd, strtok(NULL, "\n"));\
|
||||
ra.success = 1;
|
||||
qDebug() << "HOST: " << host;
|
||||
int res = sendRequest(host, 80, req, ret);
|
||||
if (res != -1) {
|
||||
QStringList list = ret.split("\n");
|
||||
ra.user = list[0];
|
||||
ra.passwd = list[1];\
|
||||
ra.success = true;
|
||||
} else {
|
||||
ra.success = 0;
|
||||
strcpy(ra.reason, ret);
|
||||
ra.success = false;
|
||||
ra.reason = ret;
|
||||
}
|
||||
puts(ret);
|
||||
qDebug() << ret;
|
||||
return ra;
|
||||
}
|
||||
|
||||
|
@ -71,12 +71,12 @@ QVariant CodecListModel::data ( const QModelIndex & index, int role) const
|
||||
}
|
||||
|
||||
|
||||
int CodecListModel::rowCount(const QModelIndex & parent) const
|
||||
int CodecListModel::rowCount(const QModelIndex & /*parent*/) const
|
||||
{
|
||||
return codecs.count();
|
||||
}
|
||||
|
||||
int CodecListModel::columnCount(const QModelIndex & parent) const
|
||||
int CodecListModel::columnCount(const QModelIndex & /*parent*/) const
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
@ -43,7 +43,12 @@ protected:
|
||||
|
||||
|
||||
public:
|
||||
Item(QListWidget *list=0)
|
||||
/**
|
||||
* Would be great to take the QListWidget as attribute
|
||||
* to be able to add the itemWidget to the item in the list.
|
||||
* For the moment, we have to do it from outside.
|
||||
*/
|
||||
Item(/*QListWidget *list=0*/)
|
||||
{
|
||||
item = NULL;
|
||||
itemWidget = NULL;
|
||||
@ -63,6 +68,7 @@ public:
|
||||
{
|
||||
return item;
|
||||
}
|
||||
|
||||
WIDGET_TYPE * getItemWidget()
|
||||
{
|
||||
return itemWidget;
|
||||
|
@ -54,7 +54,7 @@ int main(int argc, char **argv)
|
||||
|
||||
//configuration dbus
|
||||
registerCommTypes();
|
||||
SFLPhone * fenetre = new SFLPhone();
|
||||
new SFLPhone();
|
||||
|
||||
InstanceInterface & instance = InstanceInterfaceSingleton::getInstance();
|
||||
instance.Register(getpid(), APP_NAME);
|
||||
|
@ -1343,10 +1343,9 @@ void sflphone_kdeView::on1_error(MapStringString details)
|
||||
qDebug() << "Signal : Daemon error : " << details;
|
||||
}
|
||||
|
||||
void sflphone_kdeView::on1_incomingCall(const QString &accountID, const QString & callID)
|
||||
void sflphone_kdeView::on1_incomingCall(const QString & /*accountID*/, const QString & callID)
|
||||
{
|
||||
qDebug() << "Signal : Incoming Call ! ID = " << callID;
|
||||
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
|
||||
Call * call = callList->addIncomingCall(callID);
|
||||
addCallToCallList(call);
|
||||
listWidget_callList->setCurrentRow(listWidget_callList->count() - 1);
|
||||
@ -1355,7 +1354,7 @@ void sflphone_kdeView::on1_incomingCall(const QString &accountID, const QString
|
||||
|
||||
void sflphone_kdeView::on1_incomingMessage(const QString &accountID, const QString &message)
|
||||
{
|
||||
qDebug() << "Signal : Incoming Message ! \nMessage : " << message;
|
||||
qDebug() << "Signal : Incoming Message for account " << accountID << " ! \nMessage : " << message;
|
||||
}
|
||||
|
||||
void sflphone_kdeView::on1_voiceMailNotify(const QString &accountID, int count)
|
||||
@ -1363,7 +1362,7 @@ void sflphone_kdeView::on1_voiceMailNotify(const QString &accountID, int count)
|
||||
qDebug() << "Signal : VoiceMail Notify ! " << count << " new voice mails for account " << accountID;
|
||||
}
|
||||
|
||||
void sflphone_kdeView::on1_volumeChanged(const QString &device, double value)
|
||||
void sflphone_kdeView::on1_volumeChanged(const QString & /*device*/, double value)
|
||||
{
|
||||
qDebug() << "Signal : Volume Changed !";
|
||||
if(! (toolButton_recVol->isChecked() && value == 0.0))
|
||||
|
Reference in New Issue
Block a user