Skip to content
Browse files

添加群成员记录log

  • Loading branch information...
1 parent 759eae1 commit b0d07d7303ab1eb13da45c15e71b8ca249233359 @zhanlangsir committed
View
6 INSTALL
@@ -14,10 +14,14 @@ fedora:
yum install mpg123
其他发行版应该也是一样,安装mpg123即可。
-3.安装qt运行库,ubuntu用户请无视这条,ubuntu自带qt运行库,其他发行版用户可以安装以下库:
+3.安装qt运行库,ubuntu用户请无视这条,ubuntu自带qt运行库,其他基于debain的发行版用户可以安装以下库:
* libqt4-core
* libqt4-gui
* libqt4-network
* libqt4-sql
* libqt4-webkit
* libqt4-xml
+
+fedora用户安装以下库:
+* qt
+* qtwebkit
View
BIN libs/libjsoncpp.a
Binary file not shown.
View
BIN libs/liblog4qt.a
Binary file not shown.
View
BIN libs/libqxtglobalshortcut.a
Binary file not shown.
View
BIN resources/qqface/default/116.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1 src/core/qqsetting.h
@@ -54,6 +54,7 @@ class QQSettings : public QSettings
curr_login_.status = status;
curr_login_.avatar_path = avatar_path;
}
+
QString messageStylePath() const
{ return app_path_ + "/skins/messagestyle"; }
QString currentMessageStyle() const
View
3 src/friendchatdlg.cpp
@@ -4,8 +4,6 @@
#include <QScrollBar>
#include <QTextEdit>
#include <QTextCursor>
-#include <QDebug>
-#include <QMouseEvent>
#include <QFileDialog>
#include <QRegExp>
@@ -108,6 +106,7 @@ ImgSender* FriendChatDlg::getImgSender() const
void FriendChatDlg::getInfoById(QString id, QString &name, QString &avatar_path, bool &ok) const
{
+ Q_UNUSED(id)
name = name_;
avatar_path = avatar_path_.isEmpty() ? QQSkinEngine::instance()->getSkinRes("default_friend_avatar") : avatar_path_;
ok = true;
View
2 src/friendchatdlg.h
@@ -12,8 +12,6 @@ namespace Ui
class FriendChatDlg;
}
-class QMouseEvent;
-
class FriendChatDlg : public QQChatDlg
{
Q_OBJECT
View
8 src/friendrequestdlg.h
@@ -1,14 +1,15 @@
#ifndef QTQQ_FRIENDREQUESTDLG_H
#define QTQQ_FRIENDREQUESTDLG_H
+#include <QDialog>
+
+#include "core/qqmsg.h"
+
namespace Ui
{
class FriendRequestDlg;
}
-#include <QDialog>
-
-#include "core/qqmsg.h"
class FriendItemModel;
@@ -16,7 +17,6 @@ class FriendRequestDlg:public QDialog
{
Q_OBJECT
public:
- //QQFriendRequestDlg(QWidget *parnet = 0);
FriendRequestDlg(const ShareQQMsgPtr msg, FriendItemModel *model, QWidget *parent = 0);
private slots:
View
10 src/groupchatdlg.cpp
@@ -4,7 +4,6 @@
#include <QScrollBar>
#include <QDateTime>
#include <QHttpRequestHeader>
-#include <QMouseEvent>
#include <QDebug>
#include <QSqlDatabase>
#include <QSqlQuery>
@@ -340,11 +339,13 @@ void GroupChatDlg::parseGroupMemberList(const QByteArray &array)
Json::Value members = root["result"]["minfo"];
+ qDebug() << "Group:" << name_ << "member count:" << members.size() << endl;
for (unsigned int i = 0; i < members.size(); ++i)
{
QString nick = QString::fromStdString(members[i]["nick"].asString());
QString uin = QString::number(members[i]["uin"].asLargestInt());
+ qDebug() << "member:" << nick << ' ';
QQItem *info = new QQItem(QQItem::kFriend, nick, uin, model_->rootItem());
info->set_status(kOffline);
model_->insertItem(info);
@@ -393,10 +394,12 @@ void GroupChatDlg::readFromSql()
model_ = new QQItemModel();
model_->setIconSize(QSize(25, 25));
+ int i = 0;
while (query.next())
{
QString uin = query.value(0).toString();
QString nick = query.value(2).toString();
+ qDebug()<<"inserted from sql:"<<i++<<nick<<endl;
QString mark_name = query.value(3).toString();
FriendStatus stat = (FriendStatus)query.value(4).toInt();
QString avatar_path = query.value(5).toString();
@@ -432,7 +435,7 @@ void GroupChatDlg::replaceUnconverId()
{
foreach (QString id, unconvert_ids_)
{
- msgbrowse_.replaceIdToName(id, convertor_.convert(id));
+ msgbrowse_.replaceIdToName(id, findItemById(id)->markName());
}
}
@@ -499,14 +502,15 @@ void GroupChatDlg::writeMemberInfoToSql()
if ( !exist_record_count )
{
+ QString insert_command = "INSERT INTO groupmemberinfo VALUES (%1, %2, '%3', '%4', %5, '%6')";
QSqlDatabase::database().transaction();
for (int i = 0; i < model_->rootItem()->children_.count(); ++i)
{
QQItem *item = model_->rootItem()->children_[i];
//uin, gid, name, mark name, status, avatar path
- QString insert_command = "INSERT INTO groupmemberinfo VALUES (%1, %2, '%3', '%4', %5, '%6')";
query.exec(insert_command.arg(item->id()).arg(id_).arg(item->name()).arg(item->markName()).arg(item->status()).arg(item->avatarPath()));
+ qDebug() << "inserted:" << i << item->name() << ' ';
}
QSqlDatabase::database().commit();
}
View
1 src/groupchatdlg.h
@@ -19,6 +19,7 @@ class QQItem;
class QQItemModel;
class ChatManager;
class MainWindow;
+class QModelIndex;
class GroupChatDlg : public QQChatDlg
{
View
4 src/msgtip.cpp
@@ -1,12 +1,8 @@
#include "msgtip.h"
#include "ui_msgtip.h"
-#include <QDebug>
#include <QVBoxLayout>
-#include <QCursor>
-#include <QMouseEvent>
#include <QModelIndex>
-#include <QScrollBar>
#include "systemtray.h"
#include "mainwindow.h"
View
1 src/qqchatdlg.cpp
@@ -456,6 +456,7 @@ void QQChatDlg::openQQFacePanel()
QPoint face_btn_pos = QCursor::pos();
QRect qqface_panel_geometry = qqface_panel_->frameGeometry();
int new_x = face_btn_pos.x() - qqface_panel_geometry.width() / 2;
+ if ( new_x < 0 ) new_x = 0;
int new_y = face_btn_pos.y() - qqface_panel_geometry.height() + 5;
qqface_panel_->setGeometry(new_x, new_y, qqface_panel_geometry.width(), qqface_panel_geometry.height());
qqface_panel_->show();
View
32 src/qqfacepanel.cpp
@@ -1,8 +1,7 @@
#include "qqfacepanel.h"
#include "ui_qqfacepanel.h"
-#include <QDir>
-#include <QFileInfoList>
+#include <QTableWidgetItem>
#include "core/qqsetting.h"
@@ -26,6 +25,7 @@ QQFacePanel::~QQFacePanel()
delete ui_;
}
+
void QQFacePanel::onItemClicked(QTableWidgetItem *item)
{
this->hide();
@@ -39,15 +39,10 @@ void QQFacePanel::leaveEvent(QEvent *)
void QQFacePanel::loadFace()
{
- QDir qqface_dir(qqface_path_);
- QFileInfoList file_list = qqface_dir.entryInfoList(QDir::Files);
- QFileInfo file;
-
- int curr_file_count = 0;
- foreach(file, file_list)
+ for ( unsigned int i = 0; i < sizeof(no2path)/sizeof(no2path[0]); ++i )
{
- int row = curr_file_count / kPerColumn_;
- int column = curr_file_count % kPerColumn_;
+ int row = i / kPerColumn_;
+ int column = i % kPerColumn_;
if (row > ui_->tbw_qqface_->rowCount()-1)
{
@@ -55,11 +50,20 @@ void QQFacePanel::loadFace()
}
QTableWidgetItem *item = new QTableWidgetItem();
- item->setIcon(QIcon(qqface_path_ + file.fileName()));
- item->setData(Qt::UserRole, file.baseName());
+ item->setIcon(QIcon(qqface_path_ + QString::number(no2path[i]) + ".gif"));
+ item->setData(Qt::UserRole, QString::number(no2path[i]));
ui_->tbw_qqface_->setItem(row, column,item);
-
- ++curr_file_count;
}
}
+
+int QQFacePanel::no2path[105] = {
+ 14, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
+ 50, 51, 96, 53, 54, 73, 74, 75, 76, 77, 78, 55, 56, 27, 58,
+ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 97, 98, 99, 100, 101,
+ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 32, 113, 114, 115,
+ 63, 64, 59, 33, 34, 116, 66, 68, 38, 91, 92, 93, 29, 117, 72,
+ 45, 42, 39, 62, 46, 47, 71, 95, 118, 119, 120, 121, 122, 123, 124,
+ 27, 21, 23, 25, 26, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134
+ };
+
View
17 src/qqfacepanel.h
@@ -1,23 +1,22 @@
-#pragma once
+#ifndef QTQQ_QQFACEPANEL_H
+#define QTQQ_QQFACEPANEL_H
+
+#include <QDialog>
namespace Ui
{
class QQFacePanel;
}
-#include <QDialog>
-#include <QTableWidgetItem>
+class QTableWidgetItem;
class QQFacePanel : public QDialog
{
Q_OBJECT
-
public:
QQFacePanel(QWidget *parent = NULL);
~QQFacePanel();
-public:
-
signals:
void qqfaceClicked(QString id);
@@ -32,6 +31,10 @@ private slots:
private:
Ui::QQFacePanel *ui_;
- static const int kPerColumn_ = 14;
QString qqface_path_;
+
+ static const int kPerColumn_ = 15;
+ static int no2path[105];
};
+
+#endif //QTQQ_QQFACEPANEL_H
View
1 src/sesschatdlg.cpp
@@ -82,6 +82,7 @@ ImgSender* SessChatDlg::getImgSender() const
void SessChatDlg::getInfoById(QString id, QString &name, QString &avatar_path, bool &ok) const
{
+ Q_UNUSED(id)
name = name_;
avatar_path = avatar_path_.isEmpty() ? QQSkinEngine::instance()->getSkinRes("default_friend_avatar") : avatar_path_;
ok = true;
View
2 src/src.pro
@@ -20,7 +20,7 @@ PKGCONFIG += x11
PKGCONFIG += gtk+-2.0
LIBS += -L../libs
-LIBS += -ljsoncpp -llog4qt -lqjson -lqxtglobalshortcut
+LIBS += -ljsoncpp -llog4qt -lqxtglobalshortcut
OBJECTS_DIR = ../.intermediate/obj
MOC_DIR = ../.intermediate/moc
View
4 src/systemtray.cpp
@@ -4,6 +4,7 @@
#include <QDebug>
#include "traymenu.h"
+#include "core/qqsetting.h"
#undef signals
#include <gtk/gtk.h>
@@ -30,9 +31,10 @@ SystemTray::SystemTray(QObject *parent) :
menu_(NULL),
msg_tip_(NULL)
{
+ gtk_init(0, NULL);
check_cursor_pos_.setInterval(500);
connect(&check_cursor_pos_, SIGNAL(timeout()), this, SLOT(checkCursorPos()));
- tray_icon_ = gtk_status_icon_new_from_file("/home/zhanlang/projs/qtqq/skins/default/misc/qtqq.ico");
+ tray_icon_ = gtk_status_icon_new_from_file(QString(QQSettings::instance()->currSkinPath() + "/misc/qtqq.ico").toLatin1());
g_signal_connect(G_OBJECT(tray_icon_), "activate",
G_CALLBACK(gtkTrayIconActived), NULL);
View
10 src/ui/qqfacepanel.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>463</width>
- <height>279</height>
+ <width>476</width>
+ <height>255</height>
</rect>
</property>
<property name="sizePolicy">
@@ -22,6 +22,12 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableWidget" name="tbw_qqface_">
+ <property name="editTriggers">
+ <set>QAbstractItemView::NoEditTriggers</set>
+ </property>
+ <property name="selectionMode">
+ <enum>QAbstractItemView::SingleSelection</enum>
+ </property>
<property name="gridStyle">
<enum>Qt::DotLine</enum>
</property>

0 comments on commit b0d07d7

Please sign in to comment.
Something went wrong with that request. Please try again.