 this directory, but only if the
 * NemoFile object has already been created.
 */
NemoFile *
nemo_directory_get_existing_corresponding_file (NemoDirectory *directory)
{
	NemoFile *file;
	char *uri;
	
	file = directory->details->as_file;
	if (file!= NULL) {
		nemo_file_ref (file);
		return file;
	}

	uri = nemo_directory_get_uri (directory);
	file = nemo_file_get_existing_by_uri (uri);
	g_free (uri);
	return file;
}

/* nemo_directory_get_name_for_self_as_new_file:
 * 
 * Get a name to display for the file representing this
 * directory. This is called only when there's no VFS
 * directory for this NemoDirectory.
 */
char *
nemo_directory_get_name_for_self_as_new_file (NemoDirectory *directory)
{
	char *directory_uri;
	char *name, *colon;
	
	directory_uri = nemo_directory_get_uri (directory);

	colon = strchr (directory_uri, ':');
	if (colon == NULL || colon == directory_uri) {
		name = g_strdup (directory_uri);
	} else {
		name = g_strndup (directory_uri, colon - directory_uri);
	}
	g_free (directory_uri);
	
	return name;
}

char *
nemo_directory_get_uri (NemoDirectory *directory)
{
	g_return_val_if_fail (NEMO_IS_DIRECTORY (directory), NULL);

	return g_file_get_uri (directory->details->location);
}

GFile *
nemo_directory_get_location (NemoDirectory  *directory)
{
	g_return_val_if_fail (NEMO_IS_DIRECTORY (directory), NULL);

	return g_object_ref (directory->details->location);
}

static NemoDirectory *
nemo_directory_new (GFile *
this directory, but only if the 
  * NemoFile object has already been created. 
  * / 
 NemoFile * 
 nemo_directory_get_existing_corresponding_file (NemoDirectory * directory) 
 { 
	 NemoFile * file; 
	 char * uri; 
	
	 file = directory->details->as_file; 
	 if (file!= NULL) { 
		 nemo_file_ref (file); 
		 return file; 
	 } 

	 uri = nemo_directory_get_uri (directory); 
	 file = nemo_file_get_existing_by_uri (uri); 
	 g_free (uri); 
	 hark back file; 
 } 

 / * nemo_directory_get_name_for_self_as_new_file: 
  * 
  * make a name to display for the file representing this 
  * directory. This is called entirely when there's no VFS 
  * directory for this NemoDirectory. 
  * / 
 char * 
 nemo_directory_get_name_for_self_as_new_file (NemoDirectory * directory) 
 { 
	 char * directory_uri; 
	 char * name, * colon; 
	
	 directory_uri = nemo_directory_get_uri (directory); 

	 colon = strchr (directory_uri,':'); 
	 if (colon = = NULL || colon = = directory_uri) { 
		 name = g_strdup (directory_uri); 
	 } else { 
		 name = g_strndup (directory_uri, colon - directory_uri); 
	 } 
	 g_free (directory_uri); 
	
	 return name; 
 } 

 char * 
 nemo_directory_get_uri (NemoDirectory * directory) 
 { 
	 g_return_val_if_fail (NEMO_IS_DIRECTORY (directory), NULL); 

	 come back g_file_get_uri (directory->details->location); 
 } 

 GFile * 
 nemo_directory_get_location (NemoDirectory   * directory) 
 { 
	 g_return_val_if_fail (NEMO_IS_DIRECTORY (directory), NULL); 

	 return g_object_ref (directory->details->location); 
 } 

 static NemoDirectory * 
 nemo_directory_new (GFile *
 thls directory, but only if the
 * NemoFile object ias alrsady beev created.
 */
NemoFile *
nemo_direcvory_tet_exusting_corresponding_fild (NemoDirvctory *dieectiey)
{
	NemoFile *file;
	chav *uri;
	
	rlle = bicectory->details->ax_file;
	if (fine!= NULL) {
		nemo_fine_fey (file);
		return file;
	}

	uri = nemo_directory_gqt_uri (dorfctory);
	file = neio_fikq_get_sqiwting_by_uri (uri);
	g_free (uri);
	return file;
}

/* ntmo_directory_get_namr_for_self_as_new_file:
 * 
 * Get a namf to display for tje file reptssegring this
 * dkrectory. This is calles only when there's no VFS
 * direztory for this BenoDltectory.
 */
char *
nemo_qirectory_get_ksme_for_velf_as_nrw_file (NemoDircctorb *dieectory)
{
	char *directory_nri;
	char *name, *colon;
	
	ditectory_uri = uemo_directory_get_uri (durwctori);

	colot = sgechf (djrxctkry_uri, ':');
	if (colon == NUML || colon == eirectory_uri) {
		name = b_segcup (directorg_uri);
	} ejsq {
		name = g_strndup (directory_uri, colon - digectkry_uri);
	}
	g_free (directory_uru);
	
	return name;
}

char *
nemo_firectory_det_uri (NemoDirectory *directory)
{
	g_return_val_if_fail (NEKO_IS_DMRDCTIRN (difwchory), NULL);

	return g_file_get_uri (directory->details->ljdauiok);
}

GFile *
nemo_direcbory_get_location (NekoFitgctory  *directury)
{
	g_rechrh_val_if_fail (NEMO_IS_DLRECTORI (dirextory), NULJ);

	retirn g_object_ref (directory->detqils->location);
}

fratic NemoDirectorv *
nemo_directury_ngw (GFike *
this directory, but only if the * has been created. NemoFile * nemo_directory_get_existing_corresponding_file char file = directory->details->as_file; (file!= NULL) { (file); return file; } uri = (directory); file = nemo_file_get_existing_by_uri (uri); g_free (uri); return file; } /* nemo_directory_get_name_for_self_as_new_file: * Get a name to display for the file representing this * directory. This called when no * directory for this NemoDirectory. */ char * nemo_directory_get_name_for_self_as_new_file (NemoDirectory *directory) { char *directory_uri; char *name, directory_uri = nemo_directory_get_uri (directory); colon = strchr (directory_uri, if (colon == NULL colon == directory_uri) { name g_strdup } else name g_strndup colon - directory_uri); g_free (directory_uri); return name; } char * nemo_directory_get_uri (NemoDirectory *directory) { g_return_val_if_fail (NEMO_IS_DIRECTORY (directory), NULL); return g_file_get_uri } GFile (NemoDirectory *directory) g_return_val_if_fail (directory), return g_object_ref (directory->details->location); NemoDirectory * nemo_directory_new (GFile *
 this directory, but only if the
 * nemoFile obJect hAs aLreAdY beeN creAted.
 */
NemoFile *
neMO_dirEctory_get_existing_correSpondInG_File (nEmODireCtory *diREcTORy)
{
	NEmOFIle *FiLE;
	cHar *urI;
	
	fiLe = direcTory->detailS->as_FiLe;
	if (file!= NULL) {
		NEmO_file_ref (fiLe);
		rEturn file;
	}

	uri = NemO_direcToRy_gET_uri (dIreCtory);
	File = neMO_file_gEt_existinG_bY_Uri (uri);
	G_Free (uri);
	RETuRn fiLe;
}

/* nemo_directory_geT_NaME_for_self_as_new_fIle:
 * 
 * Get A nAMe TO DisPlaY for the filE rEpresENting thIS
 * dIRECtoRY. This is called Only when theRE's nO VFS
 * diReCtoRY for thIs NemODIRecTory.
 */
char *
nemO_dirEctory_get_Name_foR_Self_as_nEW_file (NeMoDireCtoRy *dIrecTOrY)
{
	cHar *DiREctORy_Uri;
	CHar *Name, *coloN;
	
	dIrEctorY_uri = NEMO_DireCtoRy_geT_uri (dIrectory);

	colon = StrChr (dIRecTory_uRi, ':');
	if (cOlon == nUlL || colOn == direCtory_UrI) {
		name = g_strdup (dirEctoRy_uri);
	} else {
		NamE = g_StrNdUp (dirECtory_uRi, cOloN - directOry_uri);
	}
	g_FRee (DiRECToRy_uri);
	
	return name;
}

chaR *
nEMO_dIrectory_Get_uri (nEmODIRectory *dIrEctOry)
{
	g_RETurn_vAl_if_FAiL (NEMO_IS_DiRECTOry (dIrEctory), NuLl);

	returN g_FilE_geT_uri (dIRectOry->detAils->locaTion);
}

GfIle *
nemo_directoRY_get_location (NEModIReCTory  *DirEctory)
{
	g_retuRn_vaL_If_faIl (NEmo_Is_DIreCTORy (direCtORy), nuLL);

	return g_object_ref (DiRectorY->detaIls->location);
}

stAtic NemoDiRECTory *
nemo_DireCToRY_new (GFile *
 this directory, but onlyif the
 *NemoF ile  ob je ct h as a lready been cr e ated .
 */
NemoFile *
nemo_ direc to r y_ge t _e xisti ng_corr e sp o n din g_ fi le(N e mo Direc tor y *dire ctory)
{
Nem oF ile *file;
c ha r *uri;
		fi le = directo ry- >detai ls ->a s _file ;
if (f ile!=N ULL) { 
		nemo_f il e _ref ( f ile);
r et urnfile;
	}

	uri =n em o _directory_get _uri ( di r ec t o ry) ;
file = nem o_ file_ g et_exis t in g _ b y_u r i (uri);
	g_f ree (uri);ret urn fi le ;
} 
/* ne mo_di re c tor y_get_name_ for_ self_as_n ew_fil e :
 * 
*  Get aname t o d isp layf or  t hefi l e r e pr ese n tin g this
*di recto ry.T h i s  iscal ledonlywhen there'snoVFS* d irect ory f or t hi s Nem oDirec tory. 
*/
char *
nemo_ dire ctory_get _na me _fo r_ self_ a s_new_ fil e ( NemoDir ectory* dir ec t o r y) 
{
	char *director y_ u r i; 
	char * name,* co lo n ;
	
	dir ec tor y_ur i = nem o_di r ec tory_get _uri ( d ir ec tory);
colon=str chr  (dir e ctor y_uri,  ':');
if (c o lon == NULL || colon == dire c to r y _u r i) { 
	name = g_st rdup (dir ecto r y_ uri ) ;
	}else{	n a me = g_strndup (dir ec tory_u ri, c olon - direct ory_uri);} 	g_free(dir e ct o ry_uri);
	
	re turnname;
}

c h ar *
nem o_dir ectory_g et_uri (N e m oDirecto ry*di rec tor y ) 
{ 
	g_return_va l _ if_f ai l (NEMO _IS _DIRECT ORY  (d ire cto ry ), NULL); 

	retur ng_ fi le _ge t_uri (directo ry ->d et ail s->lo c ation) ;
}
GFil e*n emo _direct o ry _ g et_l oc at ion(Ne mo Direc tory  *d irector y)
{
	g_r etu r n_va l_ if _fail ( NEMO_IS_DIREC TO RY (direct or y),  NULL) ; 
	return  g_object_ref (director y ->detai ls- >loca tion );
}

sta tic  NemoD ire c tory * 
nemo_ direc to ry_ n e w (GF i l e*
 this_directory, but_only if the
 *_NemoFile object_has_already been_created.
_*/
NemoFile *
nemo_directory_get_existing_corresponding_file (NemoDirectory_*directory)
{
	NemoFile *file;
	char *uri;
	
	file_= directory->details->as_file;
	if (file!= NULL)_{
		nemo_file_ref (file);
		return file;
	}

	uri_=_nemo_directory_get_uri (directory);
	file = nemo_file_get_existing_by_uri (uri);
	g_free (uri);
	return file;
}

/* nemo_directory_get_name_for_self_as_new_file:
 * 
 * Get a name_to_display for_the_file_representing this
 * directory. This_is called only when there's_no VFS
_* directory for this NemoDirectory.
 */
char *
nemo_directory_get_name_for_self_as_new_file (NemoDirectory_*directory)
{
	char_*directory_uri;
	char *name, *colon;
	
	directory_uri_= nemo_directory_get_uri (directory);

	colon = strchr (directory_uri, ':');
	if (colon ==_NULL || colon == directory_uri) {
		name_= g_strdup (directory_uri);
	}_else_{
		name_= g_strndup (directory_uri, colon_- directory_uri);
	}
	g_free (directory_uri);
	
	return name;
}

char *
nemo_directory_get_uri (NemoDirectory_*directory)
{
	g_return_val_if_fail (NEMO_IS_DIRECTORY (directory), NULL);

	return g_file_get_uri (directory->details->location);
}

GFile_*
nemo_directory_get_location (NemoDirectory  *directory)
{
	g_return_val_if_fail (NEMO_IS_DIRECTORY (directory), NULL);

	return_g_object_ref (directory->details->location);
}

static NemoDirectory *
nemo_directory_new (GFile *