mapeditor.cpp
changeset 428 9ae68208e2ff
parent 427 fb74fa7bfb4c
child 431 c2ffbc9b832d
     1.1 --- a/mapeditor.cpp	Mon Feb 12 09:28:47 2007 +0000
     1.2 +++ b/mapeditor.cpp	Mon Feb 19 12:01:52 2007 +0000
     1.3 @@ -3003,17 +3003,21 @@
     1.4  	}
     1.5  }
     1.6  
     1.7 -void MapEditor::unScrollAll()
     1.8 +void MapEditor::unscrollChilds() // FIXME saveState missing
     1.9  {
    1.10 -	BranchObj *bo;
    1.11 -	bo=mapCenter->first();
    1.12 -	while (bo) 
    1.13 +	BranchObj *bo=xelection.getBranch();
    1.14 +	if (bo)
    1.15  	{
    1.16 -		if (bo->isScrolled()) bo->toggleScroll();
    1.17 -		bo=bo->next();
    1.18 -	}
    1.19 +		bo->first();
    1.20 +		while (bo) 
    1.21 +		{
    1.22 +			if (bo->isScrolled()) bo->toggleScroll();
    1.23 +			bo=bo->next();
    1.24 +		}
    1.25 +	}	
    1.26  }
    1.27  
    1.28 +
    1.29  void MapEditor::loadFloatImage ()
    1.30  {
    1.31  	BranchObj *bo=xelection.getBranch();
    1.32 @@ -3268,10 +3272,8 @@
    1.33  	WarningDialog dia;
    1.34  	dia.showCancelButton (true);
    1.35  	dia.setText("This is a longer \nWarning");
    1.36 -	/*
    1.37  	dia.setCaption("Warning: Flux problem");
    1.38  	dia.setShowAgainName("/warnings/mapeditor");
    1.39 -	*/
    1.40  	if (dia.exec()==QDialog::Accepted)
    1.41  		cout << "accepted!\n";
    1.42  	else	
    1.43 @@ -3603,8 +3605,6 @@
    1.44  					else	
    1.45  						lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() -lmosel->getTopPad());
    1.46  				} 
    1.47 -				// reposition subbranch
    1.48 -				lmosel->reposition();	
    1.49  
    1.50  				if (lmo && (lmo!=lmosel) && xelection.getBranch() ) 
    1.51  				{
    1.52 @@ -3621,6 +3621,8 @@
    1.53  				{
    1.54  					lmosel->unsetParObjTmp();
    1.55  				}		
    1.56 +				// reposition subbranch
    1.57 +				lmosel->reposition();	
    1.58  			} // depth>0
    1.59  
    1.60  		} // no FloatImageObj
    1.61 @@ -3863,30 +3865,34 @@
    1.62  			QString s;
    1.63  			QString heading;
    1.64  			BranchObj *bo;
    1.65 -			for (int i=0; i<uris.count();++i)
    1.66 +			for (int i=0; i<uris.count();i++)
    1.67  			{
    1.68 -				bo=sel->addBranch();
    1.69 -				if (bo)
    1.70 +				// Workaround to avoid adding empty branches
    1.71 +				if (!uris.at(i).toString().isEmpty())
    1.72  				{
    1.73 -					s=uris.at(i).toLocalFile();
    1.74 -					if (!s.isEmpty()) 
    1.75 +					bo=sel->addBranch();
    1.76 +					if (bo)
    1.77  					{
    1.78 -                       QString file = QDir::convertSeparators(s);
    1.79 -                       heading = QFileInfo(file).baseName();
    1.80 -                       files.append(file);
    1.81 -                       if (file.endsWith(".vym", false))
    1.82 -                           bo->setVymLink(file);
    1.83 -                       else
    1.84 -                           bo->setURL(uris.at(i).toString());
    1.85 -                   } else 
    1.86 -				   {
    1.87 -                       bo->setURL(uris.at(i).toString());
    1.88 -                   }
    1.89 -
    1.90 -                   if (!heading.isEmpty())
    1.91 -                       bo->setHeading(heading);
    1.92 -                   else
    1.93 -                       bo->setHeading(uris.at(i).toString());
    1.94 +						s=uris.at(i).toLocalFile();
    1.95 +						if (!s.isEmpty()) 
    1.96 +						{
    1.97 +						   QString file = QDir::convertSeparators(s);
    1.98 +						   heading = QFileInfo(file).baseName();
    1.99 +						   files.append(file);
   1.100 +						   if (file.endsWith(".vym", false))
   1.101 +							   bo->setVymLink(file);
   1.102 +						   else
   1.103 +							   bo->setURL(uris.at(i).toString());
   1.104 +					   } else 
   1.105 +					   {
   1.106 +						   bo->setURL(uris.at(i).toString());
   1.107 +					   }
   1.108 +
   1.109 +					   if (!heading.isEmpty())
   1.110 +						   bo->setHeading(heading);
   1.111 +					   else
   1.112 +						   bo->setHeading(uris.at(i).toString());
   1.113 +					}
   1.114  				}
   1.115  			}
   1.116  			mapCenter->reposition();