Skip to content

Commit

Permalink
完善局域网文件传输功能
Browse files Browse the repository at this point in the history
1.修复在Windows下无法正常读取文件的问题
2.提高组网稳定性
  • Loading branch information
188080501 committed Oct 14, 2016
1 parent 0d51506 commit c8c6ce9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
Empty file modified JQTools.pro
100755 → 100644
Empty file.
Empty file modified README.md
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions components/ToolsGroup/LanFileTransport/cpp/lanfiletransport_.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ QString Manage::savePath()

void Manage::refreshLanNodes()
{
qDebug() << "refreshLanNodes";

mutex_.lock();

lanNodes_.clear();
Expand Down
10 changes: 8 additions & 2 deletions components/ToolsGroup/LanFileTransport/qml/LanFileTransport.qml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,17 @@ Item {
for( var index = 0; index < drop.urls.length; ++index )
{
var url = drop.urls[ index ].toString();
print( url );

if ( url.indexOf( "file://" ) !== 0 ) { return; }

filePaths.push( url.substr( 7 ) );
if ( Qt.platform.os === "windows" )
{
filePaths.push( url.substr( 8 ) );
}
else
{
filePaths.push( url.substr( 7 ) );
}
}

var transportResult = lanFileTransportManage.transport( hostAddress, filePaths );
Expand Down
4 changes: 2 additions & 2 deletions lib/JQNetwork/include/jqnetwork_lan.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ struct JQNetworkLanSettings
QHostAddress multicastGroupAddress;
quint16 bindPort = 0;

int checkLoopInterval = 15 * 1000;
int lanNodeTimeoutInterval = 45 * 1000;
int checkLoopInterval = 10 * 1000;
int lanNodeTimeoutInterval = 60 * 1000;

std::function< void( const JQNetworkLanNode & ) > lanNodeOnlineCallback;
std::function< void( const JQNetworkLanNode & ) > lanNodeActiveCallback;
Expand Down
2 changes: 2 additions & 0 deletions lib/JQNetwork/src/jqnetwork_lan.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ void JQNetworkLan::checkLoop()

if ( lanListModified )
{
// qDebug("111111");
this->onLanNodeListChanged();
}

Expand Down Expand Up @@ -373,6 +374,7 @@ void JQNetworkLan::onUdpSocketReadyRead()

this->onLanNodeStateOnline( lanNode );
this->onLanNodeListChanged();
// qDebug("222222");

firstOnline = true;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/JQToolsLibrary/include/JQToolsLibrary.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Qt lib import
#include <QObject>

#define JQTOOLS_VERSIONSTRING "16.10.12"
#define JQTOOLS_VERSIONSTRING "16.10.14"

class AbstractTool: public QObject
{
Expand Down

0 comments on commit c8c6ce9

Please sign in to comment.