2010年10月28日 星期四

WLNSC1000 改機資訊

改了以後可以跑自己的Apache server...也就是可以跑php囉..

See Log:
cat /var/log/messages


==========Setup Apache=========
in directory /mnt/C
tar zxvf apachexxxxx
vi /mnt/C/sys/etc/env-ng
RCNG=1

APACHE2=1 (if apache path is /mnt/C/sys/apache2)

APACHE22=1 (if apache path is /mnt/C/sys/apache22)


cp /mnt/C/sys/etc/php-ini-dist /mnt/C/sys/etc/php-ini
=========apache/conf/httpd.conf============
Modify

Listen your_ip:8080

ServerName your_ip
===========================================
Insert


AddType application/x-httpd-php .php


===========================================
reboot

Tips:
Manually start
/mnt/C/sys/apache2/bin/apachectl -f /mnt/C/sys/apache2/conf/httpd.conf &

2010年10月23日 星期六

Convert QString to Char*

If you went to convert prototype QString to char*,you can using this method:

int main(int argc, char **argv)
{
QApplication app(argc, argv);
QString str1 = "Test";

//method 1
strcpy(c_str2,str1.toUtf8());

//method 2
QByteArray ba = str1.toLatin1();
const char *c_str2 = ba.data();

printf("str2: %s", c_str2);
return app.exec();
}